diff --git a/src/validation.cpp b/src/validation.cpp --- a/src/validation.cpp +++ b/src/validation.cpp @@ -4118,11 +4118,11 @@ } const CChainParams &chainparams = config.GetChainParams(); + const Consensus::Params &consensusParams = chainparams.GetConsensus(); - if (!CheckBlock(block, state, chainparams.GetConsensus(), + if (!CheckBlock(block, state, consensusParams, BlockValidationOptions(config)) || - !ContextualCheckBlock(block, state, chainparams.GetConsensus(), - pindex->pprev)) { + !ContextualCheckBlock(block, state, consensusParams, pindex->pprev)) { if (state.IsInvalid() && !state.CorruptionPossible()) { pindex->nStatus = pindex->nStatus.withFailed(); setDirtyBlockIndex.insert(pindex); @@ -4171,9 +4171,9 @@ return AbortNode(state, std::string("System error: ") + e.what()); } - FlushStateToDisk(config.GetChainParams(), state, FlushStateMode::NONE); + FlushStateToDisk(chainparams, state, FlushStateMode::NONE); - CheckBlockIndex(chainparams.GetConsensus()); + CheckBlockIndex(consensusParams); return true; }