This commit is contained in:
jl777
2018-04-11 04:45:45 +03:00
parent 8373141bb7
commit 188e19a735

View File

@@ -693,7 +693,7 @@ uint32_t komodo_stake(arith_uint256 bnTarget,int32_t nHeight,uint256 txid,int32_
//if ( diff > 3600 ) //if ( diff > 3600 )
// diff = 3600; // diff = 3600;
//coinage = (((value * diff) / supply) * diff); //coinage = (((value * diff) / supply) * diff);
coinage = (value * diff); coinage = (value * diff) * ((diff >> 16) + 1);
//hashval = arith_uint256(supply * 64) * (UintToArith256(hash) / arith_uint256(coinage+1)); //hashval = arith_uint256(supply * 64) * (UintToArith256(hash) / arith_uint256(coinage+1));
hashval = (UintToArith256(hash) / arith_uint256(coinage+1)); hashval = (UintToArith256(hash) / arith_uint256(coinage+1));
if ( hashval <= bnTarget ) if ( hashval <= bnTarget )
@@ -720,7 +720,7 @@ 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);
} }
if ( 0 ) if ( 1 )
{ {
for (i=31; i>=24; i--) for (i=31; i>=24; i--)
fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]); fprintf(stderr,"%02x",((uint8_t *)&hashval)[i]);