Browse Source

Fix zawyMA calc

pull/37/head
jl777 5 years ago
parent
commit
cdb3980abc
  1. 8
      src/pow.cpp

8
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);

Loading…
Cancel
Save