@@ -3525,10 +3525,9 @@ bool ContextualCheckBlockHeader(const CBlockHeader& block, CValidationState& sta
35253525 return true ;
35263526}
35273527
3528- bool ContextualCheckBlock (const CBlock& block, CValidationState& state, const CBlockIndex* pindexPrev)
3528+ bool ContextualCheckBlock (const CBlock& block, CValidationState& state, const Consensus::Params& consensusParams, const CBlockIndex* pindexPrev)
35293529{
35303530 const int nHeight = pindexPrev == NULL ? 0 : pindexPrev->nHeight + 1 ;
3531- const Consensus::Params& consensusParams = Params ().GetConsensus ();
35323531
35333532 // Start enforcing BIP113 (Median Time Past) using versionbits logic.
35343533 int nLockTimeFlags = 0 ;
@@ -3689,7 +3688,8 @@ static bool AcceptBlock(const CBlock& block, CValidationState& state, const CCha
36893688 }
36903689 if (fNewBlock ) *fNewBlock = true ;
36913690
3692- if ((!CheckBlock (block, state, chainparams.GetConsensus (), GetAdjustedTime ())) || !ContextualCheckBlock (block, state, pindex->pprev )) {
3691+ if (!CheckBlock (block, state, chainparams.GetConsensus (), GetAdjustedTime ()) ||
3692+ !ContextualCheckBlock (block, state, chainparams.GetConsensus (), pindex->pprev )) {
36933693 if (state.IsInvalid () && !state.CorruptionPossible ()) {
36943694 pindex->nStatus |= BLOCK_FAILED_VALID;
36953695 setDirtyBlockIndex.insert (pindex);
@@ -3780,7 +3780,7 @@ bool TestBlockValidity(CValidationState& state, const CChainParams& chainparams,
37803780 return error (" %s: Consensus::ContextualCheckBlockHeader: %s" , __func__, FormatStateMessage (state));
37813781 if (!CheckBlock (block, state, chainparams.GetConsensus (), fCheckPOW , fCheckMerkleRoot ))
37823782 return error (" %s: Consensus::CheckBlock: %s" , __func__, FormatStateMessage (state));
3783- if (!ContextualCheckBlock (block, state, pindexPrev))
3783+ if (!ContextualCheckBlock (block, state, chainparams. GetConsensus (), pindexPrev))
37843784 return error (" %s: Consensus::ContextualCheckBlock: %s" , __func__, FormatStateMessage (state));
37853785 if (!ConnectBlock (block, state, &indexDummy, viewNew, chainparams, true ))
37863786 return false ;
0 commit comments