Skip to content

Commit

Permalink
Do not mark fInvalidFound true on high-hash block (#494)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mixa84 authored Jun 4, 2021
1 parent 95e21e6 commit 2119b59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3566,14 +3566,14 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar
if (!ConnectTip(state, chainparams, pindexConnect, pindexConnect == pindexMostWork ? pblock : std::shared_ptr<const CBlock>(), connectTrace, disconnectpool)) {
if (state.IsInvalid()) {
fContinue = false;
fInvalidFound = true;
// The block violates a consensus rule.
auto reason = state.GetReason();
if (reason == ValidationInvalidReason::BLOCK_INVALID_HEADER) {
// at this stage only high hash error can be in header
// so just skip that block
continue;
}
fInvalidFound = true;
InvalidChainFound(vpindexToConnect.front());
if (reason == ValidationInvalidReason::BLOCK_MUTATED) {
// prior EunosHeight we shoutdown node on mutated block
Expand Down

0 comments on commit 2119b59

Please sign in to comment.