aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoss Nicoll <[email protected]>2015-08-10 20:24:39 +0100
committerRoss Nicoll <[email protected]>2015-08-10 20:24:39 +0100
commita5b7abf8a67e13c7f6dff1a16f970bc94d676ce5 (patch)
treec75c5a755699e66ef175206c16077e110c5c9780 /src
parentMerge pull request #1234 from patricklodder/1.10-constraint-flags (diff)
parentRe-enable SuperMajority triggered activation for v2 block constraints (diff)
downloaddiscoin-a5b7abf8a67e13c7f6dff1a16f970bc94d676ce5.tar.xz
discoin-a5b7abf8a67e13c7f6dff1a16f970bc94d676ce5.zip
Merge pull request #1231 from patricklodder/1.10-majority-v2-constraints
Re-enable SuperMajority triggered activation for v2 block constraints
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0f4fdf26f..92d425ab8 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2790,7 +2790,7 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
}
// Reject block.nVersion=1 blocks when 95% (75% on testnet) of the network has upgraded:
- // Dogecoin: Version 2 enforcement was never used
+ // Dogecoin: Version 2 enforcement was never used, reject from v3 softfork
//if (block.nVersion < 2 && IsSuperMajority(2, pindexPrev, consensusParams.nMajorityRejectBlockOutdated, consensusParams))
// return state.Invalid(error("%s: rejected nVersion=1 block", __func__),
// REJECT_OBSOLETE, "bad-version");
@@ -2807,6 +2807,9 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
{
const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1;
+ const CChainParams& chainParams = Params();
+ const Consensus::Params& consensusParams = chainParams.GetConsensus(nHeight);
+
// Check that all transactions are finalized
BOOST_FOREACH(const CTransaction& tx, block.vtx)
if (!IsFinalTx(tx, nHeight, block.GetBlockTime())) {
@@ -2815,8 +2818,8 @@ bool ContextualCheckBlock(const CBlock& block, CValidationState& state, CBlockIn
// Enforce block.nVersion=2 rule that the coinbase starts with serialized block height
// if 750 of the last 1,000 blocks are version 2 or greater (51/100 if testnet):
- // Dogecoin: Block v2 was never enforced
- if (block.nVersion >= 3)
+ // Dogecoin: Block v2 was never enforced, so we trigger this against v3
+ if (block.nVersion >= 2 && IsSuperMajority(3, pindexPrev, consensusParams.nMajorityEnforceBlockUpgrade, consensusParams))
{
CScript expect = CScript() << nHeight;
if (block.vtx[0].vin[0].scriptSig.size() < expect.size() ||