diff --git a/src/miner.cpp b/src/miner.cpp index b76226ecc..e2e5d2f7e 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -103,7 +103,7 @@ void UpdateTime(CBlockHeader* pblock, const Consensus::Params& consensusParams, pblock->nTime = std::max(pindexPrev->GetMedianTimePast()+1, GetAdjustedTime()); // Updating time can change work required on testnet: - if (consensusParams.nPowAllowMinDifficultyBlocksAfterHeight) { + if (consensusParams.nPowAllowMinDifficultyBlocksAfterHeight != boost::none) { pblock->nBits = GetNextWorkRequired(pindexPrev, pblock, consensusParams); } } @@ -727,7 +727,7 @@ void static BitcoinMiner() // Update nNonce and nTime pblock->nNonce = ArithToUint256(UintToArith256(pblock->nNonce) + 1); UpdateTime(pblock, chainparams.GetConsensus(), pindexPrev); - if (chainparams.GetConsensus().nPowAllowMinDifficultyBlocksAfterHeight) + if (chainparams.GetConsensus().nPowAllowMinDifficultyBlocksAfterHeight != boost::none) { // Changing pblock->nTime can change work required on testnet: hashTarget.SetCompact(pblock->nBits); diff --git a/src/pow.cpp b/src/pow.cpp index 82c817efb..743df08ee 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -27,7 +27,7 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead { // Comparing to pindexLast->nHeight with >= because this function // returns the work required for the block after pindexLast. - if (params.nPowAllowMinDifficultyBlocksAfterHeight && + if (params.nPowAllowMinDifficultyBlocksAfterHeight != boost::none && pindexLast->nHeight >= params.nPowAllowMinDifficultyBlocksAfterHeight.get()) { // Special difficulty rule for testnet: