diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3443,13 +3443,12 @@ * Do not call this for any check that depends on the context. * For context-dependent calls, see ContextualCheckBlockHeader. */ -static bool CheckBlockHeader(const Config &config, const CBlockHeader &block, - CValidationState &state, +static bool CheckBlockHeader(const CBlockHeader &block, CValidationState &state, + const Consensus::Params ¶ms, BlockValidationOptions validationOptions) { // Check proof of work matches claimed amount if (validationOptions.shouldValidatePoW() && - !CheckProofOfWork(block.GetHash(), block.nBits, - config.GetChainParams().GetConsensus())) { + !CheckProofOfWork(block.GetHash(), block.nBits, params)) { return state.DoS(50, false, REJECT_INVALID, "high-hash", false, "proof of work failed"); } @@ -3467,7 +3466,8 @@ // Check that the header is valid (particularly PoW). This is mostly // redundant with the call in AcceptBlockHeader. - if (!CheckBlockHeader(config, block, state, validationOptions)) { + if (!CheckBlockHeader(block, state, config.GetChainParams().GetConsensus(), + validationOptions)) { return false; } @@ -3796,7 +3796,7 @@ return true; } - if (!CheckBlockHeader(config, block, state, + if (!CheckBlockHeader(block, state, chainparams.GetConsensus(), BlockValidationOptions(config))) { return error("%s: Consensus::CheckBlockHeader: %s, %s", __func__, hash.ToString(), FormatStateMessage(state));