Skip to content

Commit c0a0c72

Browse files
committed
validation: Disable CheckForkWarningConditions for background chainstate
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.
1 parent 393f323 commit c0a0c72

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/validation.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2020,7 +2020,8 @@ void Chainstate::CheckForkWarningConditions()
20202020

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

0 commit comments

Comments
 (0)