diff --git a/src/chainparams.cpp b/src/chainparams.cpp index a86c68ebb..b0309b76a 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -135,6 +135,7 @@ public: consensus.nExtendedClaimExpirationTime = 2102400; consensus.nExtendedClaimExpirationForkHeight = 400155; consensus.fPowAllowMinDifficultyBlocks = false; + consensus.nAllowMinDiffMinHeight = consensus.nAllowMinDiffMaxHeight = -1; consensus.fPowNoRetargeting = false; consensus.nNormalizedNameForkHeight = 539940; // targeting 21 March 2019 consensus.nRuleChangeActivationThreshold = 1916; // 95% of 2016 @@ -223,6 +224,8 @@ public: consensus.nExtendedClaimExpirationTime = 2102400; consensus.nExtendedClaimExpirationForkHeight = 278160; consensus.fPowAllowMinDifficultyBlocks = true; + consensus.nAllowMinDiffMinHeight = 277299; + consensus.nAllowMinDiffMaxHeight = 1100000; consensus.fPowNoRetargeting = false; consensus.nNormalizedNameForkHeight = 993380; // targeting, 21 Feb 2019 consensus.nRuleChangeActivationThreshold = 1512; // 75% for testchains @@ -304,6 +307,7 @@ public: consensus.nExtendedClaimExpirationTime = 600; consensus.nExtendedClaimExpirationForkHeight = 800; consensus.fPowAllowMinDifficultyBlocks = false; + consensus.nAllowMinDiffMinHeight = consensus.nAllowMinDiffMaxHeight = -1; consensus.fPowNoRetargeting = false; consensus.nNormalizedNameForkHeight = 250; // SDK depends upon this number consensus.nRuleChangeActivationThreshold = 108; // 75% for testchains diff --git a/src/consensus/params.h b/src/consensus/params.h index 913121cb3..414f0a852 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -55,6 +55,8 @@ struct Params { /** Proof of work parameters */ uint256 powLimit; bool fPowAllowMinDifficultyBlocks; + int nAllowMinDiffMinHeight; + int nAllowMinDiffMaxHeight; bool fPowNoRetargeting; int nNormalizedNameForkHeight; int64_t nPowTargetSpacing; diff --git a/src/pow.cpp b/src/pow.cpp index 31995fdf0..8f3c583fe 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -18,7 +18,8 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead if (pindexLast == NULL) return nProofOfWorkLimit; - if (params.fPowAllowMinDifficultyBlocks && pindexLast->nHeight >= 277299 && pindexLast->nHeight < 1100000) + if (params.fPowAllowMinDifficultyBlocks && pindexLast->nHeight >= params.nAllowMinDiffMinHeight + && pindexLast->nHeight < params.nAllowMinDiffMaxHeight) { // Special difficulty rule for testnet: // If the new block's timestamp is twice the target block time