diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index fd9b6e4b8..41e3fbfd5 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -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) { - 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; sum = arith_uint256(0); ave = sum; @@ -1170,8 +1170,9 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he } else return(target); if ( percPoS < goalperc ) // increase PoW diff -> lower bnTarget { - bnTarget = (ave * arith_uint256(goalperc)) / arith_uint256(percPoS + goalperc); - if ( 0 ) + factor = arith_uint256(goalperc)) / arith_uint256(percPoS + goalperc); + bnTarget = (ave * factor * factor); + if ( 1 ) { for (i=31; i>=24; i--) fprintf(stderr,"%02x",((uint8_t *)&ave)[i]);