@@ -1290,7 +1290,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(c
12901290}
12911291
12921292void CChainState::InvalidBlockFound (CBlockIndex *pindex, const CValidationState &state) {
1293- if (! state.CorruptionPossible () ) {
1293+ if (state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
12941294 pindex->nStatus |= BLOCK_FAILED_VALID;
12951295 m_failed_blocks.insert (pindex);
12961296 setDirtyBlockIndex.insert (pindex);
@@ -1791,7 +1791,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
17911791 // re-enforce that rule here (at least until we make it impossible for
17921792 // GetAdjustedTime() to go backward).
17931793 if (!CheckBlock (block, state, chainparams.GetConsensus (), !fJustCheck , !fJustCheck )) {
1794- if (state.CorruptionPossible () ) {
1794+ if (state.GetReason () == ValidationInvalidReason::BLOCK_MUTATED ) {
17951795 // We don't write down blocks to disk if they may have been
17961796 // corrupted, so this should be impossible unless we're having hardware
17971797 // problems.
@@ -2570,7 +2570,7 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar
25702570 if (!ConnectTip (state, chainparams, pindexConnect, pindexConnect == pindexMostWork ? pblock : std::shared_ptr<const CBlock>(), connectTrace, disconnectpool)) {
25712571 if (state.IsInvalid ()) {
25722572 // The block violates a consensus rule.
2573- if (! state.CorruptionPossible () ) {
2573+ if (state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
25742574 InvalidChainFound (vpindexToConnect.front ());
25752575 }
25762576 state = CValidationState ();
@@ -3509,7 +3509,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CVali
35093509
35103510 if (!CheckBlock (block, state, chainparams.GetConsensus ()) ||
35113511 !ContextualCheckBlock (block, state, chainparams.GetConsensus (), pindex->pprev )) {
3512- if (state.IsInvalid () && ! state.CorruptionPossible () ) {
3512+ if (state.IsInvalid () && state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
35133513 pindex->nStatus |= BLOCK_FAILED_VALID;
35143514 setDirtyBlockIndex.insert (pindex);
35153515 }
0 commit comments