From cdb3980abc0ae37ceb5eebf582988661eaf74c56 Mon Sep 17 00:00:00 2001 From: jl777 Date: Sat, 3 Aug 2019 03:12:13 -1100 Subject: [PATCH] Fix zawyMA calc --- src/pow.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pow.cpp b/src/pow.cpp index 3d616dc42..b32bf845f 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -42,10 +42,10 @@ uint32_t komodo_chainactive_timestamp(); unsigned int lwmaGetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHeader *pblock, const Consensus::Params& params); unsigned int lwmaCalculateNextWorkRequired(const CBlockIndex* pindexLast, const Consensus::Params& params); -arith_uint256 zawy_targetMA(arith_uint256 easy,arith_uint256 bnTarget,int32_t divisor) +arith_uint256 zawy_targetMA(arith_uint256 easy,arith_uint256 bnTarget,int32_t numerator) { - bnTarget /= arith_uint256(divisor); - bnTarget *= arith_uint256(ASSETCHAINS_BLOCKTIME); + bnTarget /= arith_uint256(ASSETCHAINS_BLOCKTIME); + bnTarget *= arith_uint256(numerator); if ( bnTarget > easy ) bnTarget = easy; return(bnTarget); @@ -166,7 +166,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead } else if ( block12diff != 0 && block7diff != 0 && block4diff != 0 ) { - if ( block4diff > 4 && block4diff < ASSETCHAINS_BLOCKTIME/2 ) // for 10x and higher hashrate increases + if ( (0) && block4diff > 4 && block4diff < ASSETCHAINS_BLOCKTIME/2 ) // added /2 { block4diff += (2 * ASSETCHAINS_BLOCKTIME) / 3; bnTarget = bnTarget * arith_uint256(block4diff) / arith_uint256(ASSETCHAINS_BLOCKTIME * 2);