diff options
author | Pieter Wuille <pieter@wuille.net> | 2022-08-13 16:04:20 -0400 |
---|---|---|
committer | Suhas Daftuar <sdaftuar@gmail.com> | 2022-08-29 08:10:35 -0400 |
commit | 738421c50f2dbd7395b50a5dbdf6168b07435e62 (patch) | |
tree | 2976c5ba04c4bdf180b6839c3431f104563507ee /src | |
parent | 376086fc5a187f5b2ab3a0d1202ed4e6c22bdb50 (diff) | |
download | bitcoin-738421c50f2dbd7395b50a5dbdf6168b07435e62.tar.xz |
Emit NotifyHeaderTip signals for pre-synchronization progress
Diffstat (limited to 'src')
-rw-r--r-- | src/validation.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
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); |