From 0aa4f2fccc41d0a5f1842d320d3e8c3fc8c5e6fb Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 21 Jul 2018 04:54:42 -1100 Subject: [PATCH] Adjust diff downward much faster --- src/komodo_bitcoind.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/komodo_bitcoind.h b/src/komodo_bitcoind.h index 516f31187..55e1ae2cf 100644 --- a/src/komodo_bitcoind.h +++ b/src/komodo_bitcoind.h @@ -1375,7 +1375,9 @@ arith_uint256 komodo_PoWtarget(int32_t *percPoSp,arith_uint256 target,int32_t he } else if ( percPoS > goalperc ) // decrease PoW diff -> raise bnTarget { - bnTarget = (ave * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc); + bnTarget = ((ave * arith_uint256(goalperc)) + (easydiff * arith_uint256(percPoS))) / arith_uint256(percPoS + goalperc); + //bnTarget = (bnTarget * arith_uint256(percPoS * percPoS * percPoS)) / arith_uint256(goalperc * goalperc); + bnTarget = (bnTarget / arith_uint256(goalperc * goalperc)) * arith_uint256(percPoS * percPoS * percPoS); if ( bnTarget > easydiff ) bnTarget = easydiff; else if ( bnTarget < ave ) // overflow