@@ -4188,9 +4188,9 @@ bool ChainstateManager::ProcessNewBlockHeaders(const std::vector<CBlockHeader>&
4188
4188
if (NotifyHeaderTip (*this )) {
4189
4189
if (IsInitialBlockDownload () && ppindex && *ppindex) {
4190
4190
const CBlockIndex& last_accepted{**ppindex};
4191
- const int64_t blocks_left{(GetTime () - last_accepted.GetBlockTime ()) / GetConsensus ().nPowTargetSpacing };
4191
+ int64_t blocks_left{(NodeClock::now () - last_accepted.Time ()) / GetConsensus ().PowTargetSpacing () };
4192
4192
const double progress{100.0 * last_accepted.nHeight / (last_accepted.nHeight + blocks_left)};
4193
- LogPrintf (" Synchronizing blockheaders, height: %d (~%.2f%%)\n " , last_accepted.nHeight , progress);
4193
+ LogInfo (" Synchronizing blockheaders, height: %d (~%.2f%%)\n " , last_accepted.nHeight , progress);
4194
4194
}
4195
4195
}
4196
4196
return true ;
@@ -4214,9 +4214,9 @@ void ChainstateManager::ReportHeadersPresync(const arith_uint256& work, int64_t
4214
4214
bool initial_download = IsInitialBlockDownload ();
4215
4215
GetNotifications ().headerTip (GetSynchronizationState (initial_download), height, timestamp, /* presync=*/ true );
4216
4216
if (initial_download) {
4217
- const int64_t blocks_left{(GetTime () - timestamp) / GetConsensus ().nPowTargetSpacing };
4217
+ int64_t blocks_left{(NodeClock::now () - NodeSeconds{std::chrono::seconds{ timestamp}} ) / GetConsensus ().PowTargetSpacing () };
4218
4218
const double progress{100.0 * height / (height + blocks_left)};
4219
- LogPrintf (" Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n " , height, progress);
4219
+ LogInfo (" Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n " , height, progress);
4220
4220
}
4221
4221
}
4222
4222
0 commit comments