diff options
| author | Ross Nicoll <[email protected]> | 2017-09-24 15:56:19 +0100 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 19:23:29 +0100 |
| commit | 1de15c70ce8065334fd827b137eba8fb899b527a (patch) | |
| tree | 1ee5cc2bc768e4d018aebb403e960462d7ce18b6 /src/pow.cpp | |
| parent | Sync mining code from Namecore to resolve unit test failures (#1385) (diff) | |
| download | discoin-1de15c70ce8065334fd827b137eba8fb899b527a.tar.xz discoin-1de15c70ce8065334fd827b137eba8fb899b527a.zip | |
Sync changes from Dogecoin 1.10
Diffstat (limited to 'src/pow.cpp')
| -rw-r--r-- | src/pow.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/pow.cpp b/src/pow.cpp index a8d0efdab..8bbb66a70 100644 --- a/src/pow.cpp +++ b/src/pow.cpp @@ -21,8 +21,21 @@ unsigned int GetNextWorkRequired(const CBlockIndex* pindexLast, const CBlockHead if (pindexLast == NULL) return nProofOfWorkLimit; + // Dogecoin: Special rules for minimum difficulty blocks with Digishield + if (AllowDigishieldMinDifficultyForBlock(pindexLast, pblock, params)) + { + // Special difficulty rule for testnet: + // If the new block's timestamp is more than 2* nTargetSpacing minutes + // then allow mining of a min-difficulty block. + return nProofOfWorkLimit; + } + // Only change once per difficulty adjustment interval - if ((pindexLast->nHeight+1) % params.DifficultyAdjustmentInterval() != 0) + bool fNewDifficultyProtocol = (pindexLast->nHeight >= 145000); + const int64_t difficultyAdjustmentInterval = fNewDifficultyProtocol + ? 1 + : params.DifficultyAdjustmentInterval(); + if ((pindexLast->nHeight+1) % difficultyAdjustmentInterval != 0) { if (params.fPowAllowMinDifficultyBlocks) { |