mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
Emit NotifyHeaderTip signals for pre-synchronization progress
This commit is contained in:
parent
376086fc5a
commit
738421c50f
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue