Test
This commit is contained in:
@@ -675,7 +675,7 @@ int32_t komodo_stake(int32_t nHeight,uint256 hash,int32_t n,uint32_t blocktime,u
|
||||
uint32_t txtime,minutes; uint64_t value;
|
||||
txtime = komodo_txtime(&value,hash,n);
|
||||
minutes = (blocktime - txtime) / 60;
|
||||
fprintf(stderr,"txtime.%u blocktime.%u prev.%u gap.%d minutes.%d %.8f\n",txtime,blocktime,prevtime,(int32_t)(blocktime - prevtime),minutes,dstr(value));
|
||||
fprintf(stderr,"ht.%d txtime.%u blocktime.%u prev.%u gap.%d minutes.%d %.8f\n",nHeight,txtime,blocktime,prevtime,(int32_t)(blocktime - prevtime),minutes,dstr(value));
|
||||
if ( nHeight < 200 )
|
||||
return(1);
|
||||
else return(0);
|
||||
|
||||
@@ -3493,7 +3493,7 @@ bool CheckBlockHeader(int32_t height,CBlockIndex *pindex, const CBlockHeader& bl
|
||||
}
|
||||
if (blockhdr.GetBlockTime() > GetAdjustedTime() + 60)
|
||||
return state.Invalid(error("CheckBlockHeader(): block timestamp too far in the future"),REJECT_INVALID, "time-too-new");
|
||||
else if ( ASSETCHAINS_STAKED != 0 && pindex->nTime <= pindex->pprev->nTime )
|
||||
else if ( ASSETCHAINS_STAKED != 0 && pindex != 0 && pindex->pprev != 0 && pindex->nTime <= pindex->pprev->nTime )
|
||||
{
|
||||
fprintf(stderr,"ht.%d %u vs ht.%d %u, is not monotonic\n",pindex->nHeight,pindex->nTime,pindex->pprev->nHeight,pindex->pprev->nTime);
|
||||
return state.Invalid(error("CheckBlockHeader(): block timestamp needs to always increase"),REJECT_INVALID, "time-too-new");
|
||||
|
||||
@@ -4499,8 +4499,8 @@ int32_t komodo_staked(uint32_t *blocktimep,uint32_t *txtimep,uint256 *utxotxidp,
|
||||
komodo_accrued_interest(&txheight,&locktime,out.tx->GetHash(),out.i,0,nValue,(int32_t)tipindex->nHeight);
|
||||
interest = komodo_interest(txheight,nValue,out.tx->nLockTime,tipindex->nTime);
|
||||
//entry.push_back(Pair("interest",ValueFromAmount(interest)));
|
||||
komodo_stake((uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime);
|
||||
}
|
||||
komodo_stake((uint32_t)chainActive.Tip()->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)chainActive.Tip()->nTime);
|
||||
//fprintf(stderr,"(%s) %s/v%d nValue %.8f locktime.%u txheight.%d pindexht.%d\n",CBitcoinAddress(address).ToString().c_str(),out.tx->GetHash().GetHex().c_str(),out.i,(double)nValue/COIN,locktime,txheight,pindex->nHeight);
|
||||
}
|
||||
bool signSuccess; SignatureData sigdata; uint64_t txfee; uint8_t *ptr; uint256 revtxid,utxotxid;
|
||||
|
||||
Reference in New Issue
Block a user