Skip to content

Commit

Permalink
Merge bitcoin/bitcoin#30962: validation: Disable CheckForkWarningCond…
Browse files Browse the repository at this point in the history
…itions for background chainstate

c0a0c72 validation: Disable CheckForkWarningConditions for background chainstate (Martin Zumsande)

Pull request description:

  The comparison of `m_best_invalid` with the tip of the chainstate makes no sense for the background chainstate and can lead to incorrect log messages.

  Fixes #30958

ACKs for top commit:
  fjahr:
    utACK c0a0c72
  achow101:
    ACK c0a0c72
  TheCharlatan:
    ACK c0a0c72
  tdb3:
    CR ACK c0a0c72

Tree-SHA512: 316811b1ade8521681f3a105c7db59dfdb27b1e13efeba95cd6183d750db2e07f48968e8fc54fe3834d3311519cf8c6b77d7e0fd61facbf2b07598e79110ff85
  • Loading branch information
achow101 committed Sep 25, 2024
2 parents 39219fe + c0a0c72 commit da612ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2020,7 +2020,8 @@ void Chainstate::CheckForkWarningConditions()

// Before we get past initial download, we cannot reliably alert about forks
// (we assume we don't get stuck on a fork before finishing our initial sync)
if (m_chainman.IsInitialBlockDownload()) {
// Also not applicable to the background chainstate
if (m_chainman.IsInitialBlockDownload() || this->GetRole() == ChainstateRole::BACKGROUND) {
return;
}

Expand Down

0 comments on commit da612ce

Please sign in to comment.