Test
This commit is contained in:
@@ -675,6 +675,8 @@ uint32_t komodo_stake(int32_t nHeight,uint256 hash,int32_t n,uint32_t blocktime,
|
|||||||
uint32_t txtime,minutes; uint64_t value,coinage;
|
uint32_t txtime,minutes; uint64_t value,coinage;
|
||||||
txtime = komodo_txtime(&value,hash,n);
|
txtime = komodo_txtime(&value,hash,n);
|
||||||
minutes = (blocktime - txtime) / 60;
|
minutes = (blocktime - txtime) / 60;
|
||||||
|
if ( txtime == 0 )
|
||||||
|
txtime = prevtime;
|
||||||
coinage = value * (blocktime - txtime);
|
coinage = value * (blocktime - txtime);
|
||||||
fprintf(stderr,"coinage.%llu ht.%d txtime.%u blocktime.%u prev.%u gap.%d minutes.%d %.8f\n",(long long)coinage,nHeight,txtime,blocktime,prevtime,(int32_t)(blocktime - prevtime),minutes,dstr(value));
|
fprintf(stderr,"coinage.%llu ht.%d txtime.%u blocktime.%u prev.%u gap.%d minutes.%d %.8f\n",(long long)coinage,nHeight,txtime,blocktime,prevtime,(int32_t)(blocktime - prevtime),minutes,dstr(value));
|
||||||
if ( nHeight < 200 )
|
if ( nHeight < 200 )
|
||||||
|
|||||||
@@ -4485,23 +4485,20 @@ int32_t komodo_staked(uint32_t *blocktimep,uint32_t *txtimep,uint256 *utxotxidp,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
entry.push_back(Pair("amount",ValueFromAmount(nValue)));*/
|
entry.push_back(Pair("amount",ValueFromAmount(nValue)));*/
|
||||||
if ( out.tx->nLockTime != 0 )
|
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
||||||
|
CBlockIndex *tipindex,*pindex = it->second;
|
||||||
|
uint64_t interest; uint32_t locktime; int32_t txheight;
|
||||||
|
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 )
|
||||||
{
|
{
|
||||||
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
eligible = komodo_stake((uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime);
|
||||||
CBlockIndex *tipindex,*pindex = it->second;
|
if ( eligible > 0 && eligible < earliest )
|
||||||
uint64_t interest; uint32_t locktime; int32_t txheight;
|
|
||||||
if ( pindex != 0 && (tipindex= chainActive.Tip()) != 0 )
|
|
||||||
{
|
{
|
||||||
eligible = komodo_stake((uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime);
|
earliest = eligible;
|
||||||
if ( eligible > 0 && eligible < earliest )
|
best_scriptPubKey = out.tx->vout[out.i].scriptPubKey;
|
||||||
{
|
*utxovaluep = (uint64_t)nValue;
|
||||||
earliest = eligible;
|
decode_hex((uint8_t *)utxotxidp,32,(char *)out.tx->GetHash().GetHex().c_str());
|
||||||
best_scriptPubKey = out.tx->vout[out.i].scriptPubKey;
|
*utxovoutp = out.i;
|
||||||
*utxovaluep = (uint64_t)nValue;
|
*txtimep = (uint32_t)out.tx->nLockTime;
|
||||||
decode_hex((uint8_t *)utxotxidp,32,(char *)out.tx->GetHash().GetHex().c_str());
|
|
||||||
*utxovoutp = out.i;
|
|
||||||
*txtimep = (uint32_t)out.tx->nLockTime;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//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);
|
//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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user