From 248dbdd1218f7f31e719112573c15126269a5a60 Mon Sep 17 00:00:00 2001 From: Patrick Lodder Date: Sun, 23 Aug 2015 15:58:47 +0200 Subject: [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. --- src/main.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/main.cpp') 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), -- cgit v1.2.3