aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2015-08-23 15:58:47 +0200
committerPatrick Lodder <[email protected]>2015-08-23 15:58:47 +0200
commit248dbdd1218f7f31e719112573c15126269a5a60 (patch)
tree1088457dc66b0dc20f9b07ce25fe4e93031cab04 /src/main.cpp
parentMerge pull request #1247 from rnicoll/1.10-attribution (diff)
downloaddiscoin-248dbdd1218f7f31e719112573c15126269a5a60.tar.xz
discoin-248dbdd1218f7f31e719112573c15126269a5a60.zip
[auxpow] Check for auxpow fork strictly
Disallow any auxpow block before the blockheight where auxpow gets enabled. For consistency, this also re-enables legacy headers on regtest.
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 5fffaa381..070b27832 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -2768,6 +2768,13 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
__func__, pindexPrev->nHeight + 1, consensusParams.nHeightEffective),
REJECT_INVALID, "late-legacy-block");
+ // Disallow AuxPow blocks before it is activated.
+ if (!consensusParams.fAllowAuxPow
+ && block.nVersion.IsAuxpow())
+ return state.DoS(100, error("%s : auxpow blocks are not allowed at height %d, parameters effective from %d",
+ __func__, pindexPrev->nHeight + 1, consensusParams.nHeightEffective),
+ REJECT_INVALID, "early-auxpow-block");
+
// Check proof of work
if (block.nBits != GetNextWorkRequired(pindexPrev, &block, consensusParams))
return state.DoS(100, error("%s: incorrect proof of work at height %d", __func__, nHeight),