From c0a0c72b4d68a4f0c53c2c4b95f4d6e399f8e4ee Mon Sep 17 00:00:00 2001 From: Martin Zumsande Date: Tue, 24 Sep 2024 14:11:20 -0400 Subject: [PATCH] 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. --- src/validation.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index b47b1d09ae1..5da3387ad29 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -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; }