aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2018-01-08 19:39:10 +0000
committerRoss Nicoll <[email protected]>2018-09-19 21:09:16 +0100
commit7b81f4de0a006a6c01b88c79b6ab34a921eb86b5 (patch)
tree71f86cbdb71ef365ec893073d63f05ccfe1f8252 /src/chainparams.cpp
parentCheck only the base block version (#1411) (diff)
downloaddiscoin-7b81f4de0a006a6c01b88c79b6ab34a921eb86b5.tar.xz
discoin-7b81f4de0a006a6c01b88c79b6ab34a921eb86b5.zip
Move COINBASE_MATURITY to the consensus parameters (#1426)
Diffstat (limited to 'src/chainparams.cpp')
-rw-r--r--src/chainparams.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/chainparams.cpp b/src/chainparams.cpp
index 1781c1f5a..b7d69c071 100644
--- a/src/chainparams.cpp
+++ b/src/chainparams.cpp
@@ -88,6 +88,7 @@ public:
consensus.nPowTargetTimespan = 4 * 60 * 60; // pre-digishield: 4 hours
consensus.nPowTargetSpacing = 60; // 1 minute
consensus.fDigishieldDifficultyCalculation = false;
+ consensus.nCoinbaseMaturity = 30;
consensus.fPowAllowMinDifficultyBlocks = false;
consensus.fPowAllowDigishieldMinDifficultyBlocks = false;
consensus.fPowNoRetargeting = false;
@@ -467,6 +468,20 @@ const CChainParams &Params() {
return *pCurrentParams;
}
+const Consensus::Params *Consensus::Params::GetConsensus(uint32_t nTargetHeight) const {
+ if (nTargetHeight < this -> nHeightEffective && this -> pLeft != NULL) {
+ return this -> pLeft -> GetConsensus(nTargetHeight);
+ } else if (nTargetHeight > this -> nHeightEffective && this -> pRight != NULL) {
+ const Consensus::Params *pCandidate = this -> pRight -> GetConsensus(nTargetHeight);
+ if (pCandidate->nHeightEffective <= nTargetHeight) {
+ return pCandidate;
+ }
+ }
+
+ // No better match below the target height
+ return this;
+}
+
CChainParams& Params(const std::string& chain)
{
if (chain == CBaseChainParams::MAIN)