Skip to content

Commit 7fcd7b8

Browse files
mzumsandeachow101
authored andcommitted
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. Github-Pull: bitcoin#30962 Rebased-From: c0a0c72
1 parent e24a25d commit 7fcd7b8

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
@@ -2023,7 +2023,8 @@ void Chainstate::CheckForkWarningConditions()
20232023

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

0 commit comments

Comments
 (0)