Test
This commit is contained in:
@@ -705,12 +705,15 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_
|
|||||||
}
|
}
|
||||||
//fprintf(stderr,"iterated until i.%d winner.%d\n",i,winner);
|
//fprintf(stderr,"iterated until i.%d winner.%d\n",i,winner);
|
||||||
}
|
}
|
||||||
for (i=31; i>=24; i--)
|
if ( 0 )
|
||||||
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
{
|
||||||
fprintf(stderr," vs ");
|
for (i=31; i>=24; i--)
|
||||||
for (i=31; i>=24; i--)
|
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);
|
||||||
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
fprintf(stderr," vs ");
|
||||||
fprintf(stderr," iter.%d winner.%d coinage.%llu %d ht.%d gap.%d %.8f/%llu\n",iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,(int32_t)(blocktime - prevtime),dstr(value),(long long)supply);
|
for (i=31; i>=24; i--)
|
||||||
|
fprintf(stderr,"%02x",((uint8_t *)&bnTarget)[i]);
|
||||||
|
fprintf(stderr," iter.%d winner.%d coinage.%llu %d ht.%d gap.%d %.8f/%llu\n",iter,winner,(long long)coinage,(int32_t)(blocktime - txtime),nHeight,(int32_t)(blocktime - prevtime),dstr(value),(long long)supply);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( nHeight < 2 )
|
if ( nHeight < 2 )
|
||||||
return(blocktime);
|
return(blocktime);
|
||||||
|
|||||||
@@ -402,13 +402,14 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
|
|||||||
pblock->nTime = blocktime;
|
pblock->nTime = blocktime;
|
||||||
if ( GetAdjustedTime()+30 < pblock->nTime )
|
if ( GetAdjustedTime()+30 < pblock->nTime )
|
||||||
{
|
{
|
||||||
printf("need to wait %d seconds to submit: ",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
//printf("need to wait %d seconds to submit: ",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
||||||
while ( GetAdjustedTime()+30 < pblock->nTime )
|
/*while ( GetAdjustedTime()+30 < pblock->nTime )
|
||||||
{
|
{
|
||||||
sleep(1);
|
sleep(30);
|
||||||
fprintf(stderr,"%d ",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
fprintf(stderr,"%d ",(int32_t)(pblock->nTime - GetAdjustedTime()));
|
||||||
}
|
}*/
|
||||||
fprintf(stderr,"finished waiting\n");
|
//fprintf(stderr,"finished waiting\n");
|
||||||
|
sleep(30);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else fprintf(stderr,"no utxos eligible for staking\n");
|
} else fprintf(stderr,"no utxos eligible for staking\n");
|
||||||
|
|||||||
@@ -4486,9 +4486,8 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
entry.push_back(Pair("amount",ValueFromAmount(nValue)));*/
|
entry.push_back(Pair("amount",ValueFromAmount(nValue)));*/
|
||||||
BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
//BlockMap::iterator it = mapBlockIndex.find(pcoinsTip->GetBestBlock());
|
||||||
CBlockIndex *tipindex;
|
CBlockIndex *tipindex;
|
||||||
uint64_t interest; uint32_t locktime; int32_t txheight;
|
|
||||||
if ( (tipindex= chainActive.Tip()) != 0 )
|
if ( (tipindex= chainActive.Tip()) != 0 )
|
||||||
{
|
{
|
||||||
eligible = komodo_stake(bnTarget,(uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime);
|
eligible = komodo_stake(bnTarget,(uint32_t)tipindex->nHeight+1,out.tx->GetHash(),out.i,*blocktimep,(uint32_t)tipindex->nTime);
|
||||||
@@ -4502,7 +4501,7 @@ int32_t komodo_staked(CMutableTransaction &txNew,uint32_t nBits,uint32_t *blockt
|
|||||||
decode_hex((uint8_t *)utxotxidp,32,(char *)out.tx->GetHash().GetHex().c_str());
|
decode_hex((uint8_t *)utxotxidp,32,(char *)out.tx->GetHash().GetHex().c_str());
|
||||||
*utxovoutp = out.i;
|
*utxovoutp = out.i;
|
||||||
*txtimep = (uint32_t)out.tx->nLockTime;
|
*txtimep = (uint32_t)out.tx->nLockTime;
|
||||||
fprintf(stderr,"earliest.%u [%d] (%s) nValue %.8f locktime.%u txheight.%d\n",earliest,(int32_t)(earliest- *blocktimep),CBitcoinAddress(address).ToString().c_str(),(double)nValue/COIN,locktime,txheight);
|
fprintf(stderr,"earliest.%u [%d] (%s) nValue %.8f locktime.%u\n",earliest,(int32_t)(earliest- *blocktimep),CBitcoinAddress(address).ToString().c_str(),(double)nValue/COIN,*txtimep);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user