diff --git a/src/validation.cpp b/src/validation.cpp index e1d6babfd0e..2f71c2c571a 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -1958,18 +1958,15 @@ void Chainstate::CheckForkWarningConditions() { AssertLockHeld(cs_main); - // 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) - // Also not applicable to the background chainstate - if (m_chainman.IsInitialBlockDownload() || this->GetRole() == ChainstateRole::BACKGROUND) { + if (this->GetRole() == ChainstateRole::BACKGROUND) { return; } if (m_chainman.m_best_invalid && m_chainman.m_best_invalid->nChainWork > m_chain.Tip()->nChainWork + (GetBlockProof(*m_chain.Tip()) * 6)) { - LogWarning("Found invalid chain at least ~6 blocks longer than our best chain. Chain state database corruption likely."); + LogWarning("Found invalid chain more than 6 blocks longer than our best chain. This could be due to database corruption or consensus incompatibility with peers."); m_chainman.GetNotifications().warningSet( kernel::Warning::LARGE_WORK_INVALID_CHAIN, - _("Warning: We do not appear to fully agree with our peers! You may need to upgrade, or other nodes may need to upgrade.")); + _("Warning: Found invalid chain more than 6 blocks longer than our best chain. This could be due to database corruption or consensus incompatibility with peers.")); } else { m_chainman.GetNotifications().warningUnset(kernel::Warning::LARGE_WORK_INVALID_CHAIN); } @@ -4638,6 +4635,8 @@ bool Chainstate::LoadChainTip() /*verification_progress=*/m_chainman.GuessVerificationProgress(tip)); } + CheckForkWarningConditions(); + return true; } diff --git a/test/functional/feature_notifications.py b/test/functional/feature_notifications.py index 519d80b9abf..c08bf07fb8d 100755 --- a/test/functional/feature_notifications.py +++ b/test/functional/feature_notifications.py @@ -25,8 +25,7 @@ FILE_CHARS_DISALLOWED = '/\\?%*:|"<>' if platform.system() == 'Windows' else '/' UNCONFIRMED_HASH_STRING = 'unconfirmed' LARGE_WORK_INVALID_CHAIN_WARNING = ( - "Warning: We do not appear to fully agree with our peers " # Exclamation mark removed by SanitizeString in AlertNotify - "You may need to upgrade, or other nodes may need to upgrade." + "Warning: Found invalid chain more than 6 blocks longer than our best chain. This could be due to database corruption or consensus incompatibility with peers." )