Test
This commit is contained in:
@@ -685,7 +685,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_
|
|||||||
hash = pindex->GetBlockHash(); // hash pubkey
|
hash = pindex->GetBlockHash(); // hash pubkey
|
||||||
diff = (blocktime - txtime);
|
diff = (blocktime - txtime);
|
||||||
coinage = (((value * diff) / supply) * diff) / supply;
|
coinage = (((value * diff) / supply) * diff) / supply;
|
||||||
hashval = arith_uint256(100000000000) * (UintToArith256(hash) / arith_uint256(coinage+1));
|
hashval = arith_uint256(1000000) * (UintToArith256(hash) / arith_uint256(coinage+1));
|
||||||
if ( hashval <= bnTarget )
|
if ( hashval <= bnTarget )
|
||||||
winner = 1;
|
winner = 1;
|
||||||
else
|
else
|
||||||
@@ -694,7 +694,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_
|
|||||||
{
|
{
|
||||||
diff = (iter + blocktime - txtime);
|
diff = (iter + blocktime - txtime);
|
||||||
coinage = (((value * diff) / supply) * diff) / supply;
|
coinage = (((value * diff) / supply) * diff) / supply;
|
||||||
hashval = arith_uint256(100000000000) * (UintToArith256(hash) / arith_uint256(coinage+1));
|
hashval = arith_uint256(1000000) * (UintToArith256(hash) / arith_uint256(coinage+1));
|
||||||
if ( hashval <= bnTarget )
|
if ( hashval <= bnTarget )
|
||||||
{
|
{
|
||||||
winner = 1;
|
winner = 1;
|
||||||
|
|||||||
@@ -4530,6 +4530,7 @@ int32_t komodo_staked(uint32_t nBits,uint32_t *blocktimep,uint32_t *txtimep,uint
|
|||||||
for (i=0; i<siglen; i++)
|
for (i=0; i<siglen; i++)
|
||||||
utxosig[i] = ptr[i];//, fprintf(stderr,"%02x",ptr[i]);
|
utxosig[i] = ptr[i];//, fprintf(stderr,"%02x",ptr[i]);
|
||||||
//fprintf(stderr," siglen.%d\n",siglen);
|
//fprintf(stderr," siglen.%d\n",siglen);
|
||||||
|
fprintf(stderr,"best %u from %u, gap %d\n",eligible,*blocktimep,(int32_t)(eligible - *blocktimep));
|
||||||
*blocktimep = eligible;
|
*blocktimep = eligible;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user