Skip to content

Commit 738421c

Browse files
sipasdaftuar
authored andcommitted
Emit NotifyHeaderTip signals for pre-synchronization progress
1 parent 376086f commit 738421c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/validation.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3727,7 +3727,9 @@ void ChainstateManager::ReportHeadersPresync(const arith_uint256& work, int64_t
37273727
if (now < m_last_presync_update + std::chrono::milliseconds{250}) return;
37283728
m_last_presync_update = now;
37293729
}
3730-
if (chainstate.IsInitialBlockDownload()) {
3730+
bool initial_download = chainstate.IsInitialBlockDownload();
3731+
uiInterface.NotifyHeaderTip(GetSynchronizationState(initial_download), height, timestamp, /*presync=*/true);
3732+
if (initial_download) {
37313733
const int64_t blocks_left{(GetTime() - timestamp) / GetConsensus().nPowTargetSpacing};
37323734
const double progress{100.0 * height / (height + blocks_left)};
37333735
LogPrintf("Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n", height, progress);

0 commit comments

Comments
 (0)