Skip to content

Commit

Permalink
Change stop-block behavior to invalidate to ensure full validation cy…
Browse files Browse the repository at this point in the history
…cle (#1318)
  • Loading branch information
prasannavl authored Jun 2, 2022
1 parent a47808b commit 85bb7ec
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2449,17 +2449,15 @@ bool StopOrInterruptConnect(const CBlockIndex *pIndex, CValidationState& state)

// Stop is processed first. So, if a block has both stop and interrupt
// stop will take priority.
if (checkMatch(pIndex, fStopBlockHeight, fStopBlockHash)) {
StartShutdown();
return true;
}

if (checkMatch(pIndex, fInterruptBlockHeight, fInterruptBlockHash)) {
if (checkMatch(pIndex, fStopBlockHeight, fStopBlockHash) || checkMatch(pIndex, fInterruptBlockHeight, fInterruptBlockHash)) {
if (pIndex->nHeight == fStopBlockHeight) {
StartShutdown();
}
state.Invalid(
ValidationInvalidReason::CONSENSUS,
error("ConnectBlock(): user interrupt"),
REJECT_INVALID,
"user-interrupt-request");
ValidationInvalidReason::CONSENSUS,
error("ConnectBlock(): user interrupt"),
REJECT_INVALID,
"user-interrupt-request");
return true;
}

Expand Down

0 comments on commit 85bb7ec

Please sign in to comment.