aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2017-04-18 13:36:32 +0100
committerRoss Nicoll <[email protected]>2018-09-19 19:21:48 +0100
commit64af132fdba545f9caaa93597ad1f0c0a6b6ade1 (patch)
tree0bd321225d98e61e1ca85fabeb47c76b2dbe84a5 /src/validation.cpp
parentUpdate DB version to 5.1 (diff)
downloaddiscoin-64af132fdba545f9caaa93597ad1f0c0a6b6ade1.tar.xz
discoin-64af132fdba545f9caaa93597ad1f0c0a6b6ade1.zip
Replace consensus values with Dogecoin equivalents
* Replace chain parameters with Dogecoin values * Update maximum coins to match Dogecoin * Disable version 2 block requirement * Update coinbase maturity to match Dogecoin
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index da2c47105..fd761460a 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -1386,7 +1386,11 @@ bool CheckTxInputs(const CTransaction& tx, CValidationState& state, const CCoins
// If prev is coinbase, check that it's matured
if (coins->IsCoinBase()) {
- if (nSpendHeight - coins->nHeight < COINBASE_MATURITY)
+ // Dogecoin: Switch maturity at depth 145,000
+ int nCoinbaseMaturity = coins->nHeight < COINBASE_MATURITY_SWITCH
+ ? COINBASE_MATURITY_OLD
+ : COINBASE_MATURITY;
+ if (nSpendHeight - coins->nHeight < nCoinbaseMaturity)
return state.Invalid(false,
REJECT_INVALID, "bad-txns-premature-spend-of-coinbase",
strprintf("tried to spend coinbase at depth %d", nSpendHeight - coins->nHeight));
@@ -2991,8 +2995,8 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
// Reject outdated version blocks when 95% (75% on testnet) of the network has upgraded:
// check for version 2, 3 and 4 upgrades
- if((block.nVersion < 2 && nHeight >= consensusParams.BIP34Height) ||
- (block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) ||
+ // Dogecoin: Version 2 enforcement was never used
+ if((block.nVersion < 3 && nHeight >= consensusParams.BIP66Height) ||
(block.nVersion < 4 && nHeight >= consensusParams.BIP65Height))
return state.Invalid(false, REJECT_OBSOLETE, strprintf("bad-version(0x%08x)", block.nVersion),
strprintf("rejected nVersion=0x%08x block", block.nVersion));