diff options
| author | Ross Nicoll <[email protected]> | 2017-12-28 15:04:08 +0000 |
|---|---|---|
| committer | Ross Nicoll <[email protected]> | 2018-09-19 19:24:06 +0100 |
| commit | 1be681a1b97b686f838af90682a57f2030d26015 (patch) | |
| tree | b2795e4a1d35004dbfd84d49b07bc54413a2a9e1 /src/consensus | |
| parent | Change BIP65/66 enforcement to match Dogecoin (#1403) (diff) | |
| download | discoin-1be681a1b97b686f838af90682a57f2030d26015.tar.xz discoin-1be681a1b97b686f838af90682a57f2030d26015.zip | |
Modify chain consensus parameters to be height aware (#1396)
* Modify chain consensus parameters to be height aware
* Correct implementation of simplified rewards in parameters
* Correct max money
* Use base block version in IsSuperMajority() instead of full version
* Correct mining of blocks in AuxPoW tests
* Add in missing pre-AuxPoW consensus checks
Diffstat (limited to 'src/consensus')
| -rw-r--r-- | src/consensus/params.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/consensus/params.h b/src/consensus/params.h index 7d8d53c44..a3a61747d 100644 --- a/src/consensus/params.h +++ b/src/consensus/params.h @@ -66,26 +66,24 @@ struct Params { int64_t nPowTargetSpacing; int64_t nPowTargetTimespan; int64_t DifficultyAdjustmentInterval() const { return nPowTargetTimespan / nPowTargetSpacing; } + + /** Dogecoin-specific parameters */ + bool fDigishieldDifficultyCalculation; + bool fPowAllowDigishieldMinDifficultyBlocks; // Allow minimum difficulty blocks where a retarget would normally occur + bool fSimplifiedRewards; // Use block height derived rewards rather than previous block hash derived + uint256 nMinimumChainWork; uint256 defaultAssumeValid; /** Auxpow parameters */ int32_t nAuxpowChainId; - int nAuxpowStartHeight; bool fStrictChainId; - int nLegacyBlocksBefore; // -1 for "always allow" + bool fAllowLegacyBlocks; - /** - * Check whether or not to allow legacy blocks at the given height. - * @param nHeight Height of the block to check. - * @return True if it is allowed to have a legacy version. - */ - bool AllowLegacyBlocks(unsigned nHeight) const - { - if (nLegacyBlocksBefore < 0) - return true; - return static_cast<int> (nHeight) < nLegacyBlocksBefore; - } + /** Height-aware consensus parameters */ + uint32_t nHeightEffective; // When these parameters come into use + struct Params *pLeft; // Left hand branch + struct Params *pRight; // Right hand branch }; } // namespace Consensus |