From 738421c50f2dbd7395b50a5dbdf6168b07435e62 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Sat, 13 Aug 2022 16:04:20 -0400 Subject: [PATCH] Emit NotifyHeaderTip signals for pre-synchronization progress --- src/validation.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/validation.cpp b/src/validation.cpp index 179e09158d..5beb613251 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -3727,7 +3727,9 @@ void ChainstateManager::ReportHeadersPresync(const arith_uint256& work, int64_t if (now < m_last_presync_update + std::chrono::milliseconds{250}) return; m_last_presync_update = now; } - if (chainstate.IsInitialBlockDownload()) { + bool initial_download = chainstate.IsInitialBlockDownload(); + uiInterface.NotifyHeaderTip(GetSynchronizationState(initial_download), height, timestamp, /*presync=*/true); + if (initial_download) { const int64_t blocks_left{(GetTime() - timestamp) / GetConsensus().nPowTargetSpacing}; const double progress{100.0 * height / (height + blocks_left)}; LogPrintf("Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n", height, progress);