Test
This commit is contained in:
@@ -1141,7 +1141,7 @@ uint32_t komodo_stake(int32_t validateflag,arith_uint256 bnTarget,int32_t nHeigh
|
|||||||
|
|
||||||
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc)
|
arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t height,int32_t goalperc)
|
||||||
{
|
{
|
||||||
CBlockIndex *pindex; arith_uint256 bnTarget,hashval,sum,ave; bool fNegative,fOverflow; int32_t i,n,ht,percPoS,diff;
|
CBlockIndex *pindex; arith_uint256 bnTarget,hashval,sum,ave,factor; bool fNegative,fOverflow; int32_t i,n,ht,percPoS,diff;
|
||||||
*percPoSp = percPoS = 0;
|
*percPoSp = percPoS = 0;
|
||||||
sum = arith_uint256(0);
|
sum = arith_uint256(0);
|
||||||
ave = sum;
|
ave = sum;
|
||||||
@@ -1170,8 +1170,9 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he
|
|||||||
} else return(target);
|
} else return(target);
|
||||||
if ( percPoS < goalperc ) // increase PoW diff -> lower bnTarget
|
if ( percPoS < goalperc ) // increase PoW diff -> lower bnTarget
|
||||||
{
|
{
|
||||||
bnTarget = (ave * arith_uint256(goalperc)) / arith_uint256(percPoS + goalperc);
|
factor = arith_uint256(goalperc)) / arith_uint256(percPoS + goalperc);
|
||||||
if ( 0 )
|
bnTarget = (ave * factor * factor);
|
||||||
|
if ( 1 )
|
||||||
{
|
{
|
||||||
for (i=31; i>=24; i--)
|
for (i=31; i>=24; i--)
|
||||||
fprintf(stderr,"%02x",((uint8_t *)&ave)[i]);
|
fprintf(stderr,"%02x",((uint8_t *)&ave)[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user