diff --git a/src/miner.cpp b/src/miner.cpp index ddb1a4bb7..791b8ba18 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -1449,13 +1449,14 @@ void static BitcoinMiner_noeq() } else if ( ASSETCHAINS_ADAPTIVEPOW != 0 && ASSETCHAINS_STAKED == 0 ) { - arith_uint256 origtarget; + arith_uint256 origtarget; bool fNegative,fOverflow; uint32_t elapsed = (pblock->nTime - komodo_heightstamp(Mining_height-1)); if ( elapsed > 777 ) { elapsed -= 777; + origtarget = HASHTarget; HASHTarget_POW = HASHTarget * arith_uint256(elapsed * elapsed); - if ( bnTarget < origtarget ) // deal with underflow + if ( HASHTarget < origtarget ) // deal with underflow { bnTarget.SetCompact(KOMODO_MINDIFF_NBITS,&fNegative,&fOverflow); fprintf(stderr,"miner underflowed, set to mindiff\n"); diff --git a/src/pow.cpp b/src/pow.cpp index 09fdf0c9c..47d538031 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -460,6 +460,7 @@ bool CheckProofOfWork(const CBlockHeader &blkHeader, uint8_t *pubkey33, int32_t if ( elapsed > 777 ) { elapsed -= 777; + origtarget = bnTarget; bnTarget = bnTarget * arith_uint256(elapsed * elapsed); if ( bnTarget < origtarget ) // deal with underflow {