Skip to content

Commit

Permalink
validation: Disable CheckForkWarningConditions for background chainstate
Browse files Browse the repository at this point in the history
The comparison of m_best_invalid with the tip of the respective chainstate
makes no sense for the background chainstate, and can lead to incorrect
error messages.
  • Loading branch information
mzumsande committed Sep 24, 2024
1 parent 06a539f commit 88ac1d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/validation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2018,6 +2018,10 @@ void Chainstate::CheckForkWarningConditions()
{
AssertLockHeld(cs_main);

// Not applicable to the background chainstate
if (GetRole() == ChainstateRole::BACKGROUND) {
return;
}
// 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()) {
Expand Down

0 comments on commit 88ac1d0

Please sign in to comment.