aboutsummaryrefslogtreecommitdiff
path: root/src/chainparams.cpp
diff options
context:
space:
mode:
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)