@@ -1290,7 +1290,7 @@ void static InvalidChainFound(CBlockIndex* pindexNew) EXCLUSIVE_LOCKS_REQUIRED(c
1290
1290
}
1291
1291
1292
1292
void CChainState::InvalidBlockFound (CBlockIndex *pindex, const CValidationState &state) {
1293
- if (! state.CorruptionPossible () ) {
1293
+ if (state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
1294
1294
pindex->nStatus |= BLOCK_FAILED_VALID;
1295
1295
m_failed_blocks.insert (pindex);
1296
1296
setDirtyBlockIndex.insert (pindex);
@@ -1791,7 +1791,7 @@ bool CChainState::ConnectBlock(const CBlock& block, CValidationState& state, CBl
1791
1791
// re-enforce that rule here (at least until we make it impossible for
1792
1792
// GetAdjustedTime() to go backward).
1793
1793
if (!CheckBlock (block, state, chainparams.GetConsensus (), !fJustCheck , !fJustCheck )) {
1794
- if (state.CorruptionPossible () ) {
1794
+ if (state.GetReason () == ValidationInvalidReason::BLOCK_MUTATED ) {
1795
1795
// We don't write down blocks to disk if they may have been
1796
1796
// corrupted, so this should be impossible unless we're having hardware
1797
1797
// problems.
@@ -2570,7 +2570,7 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar
2570
2570
if (!ConnectTip (state, chainparams, pindexConnect, pindexConnect == pindexMostWork ? pblock : std::shared_ptr<const CBlock>(), connectTrace, disconnectpool)) {
2571
2571
if (state.IsInvalid ()) {
2572
2572
// The block violates a consensus rule.
2573
- if (! state.CorruptionPossible () ) {
2573
+ if (state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
2574
2574
InvalidChainFound (vpindexToConnect.front ());
2575
2575
}
2576
2576
state = CValidationState ();
@@ -3509,7 +3509,7 @@ bool CChainState::AcceptBlock(const std::shared_ptr<const CBlock>& pblock, CVali
3509
3509
3510
3510
if (!CheckBlock (block, state, chainparams.GetConsensus ()) ||
3511
3511
!ContextualCheckBlock (block, state, chainparams.GetConsensus (), pindex->pprev )) {
3512
- if (state.IsInvalid () && ! state.CorruptionPossible () ) {
3512
+ if (state.IsInvalid () && state.GetReason () != ValidationInvalidReason::BLOCK_MUTATED ) {
3513
3513
pindex->nStatus |= BLOCK_FAILED_VALID;
3514
3514
setDirtyBlockIndex.insert (pindex);
3515
3515
}
0 commit comments