aboutsummaryrefslogtreecommitdiff
path: root/src/validation.cpp
diff options
context:
space:
mode:
authorMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-03-13 15:11:28 +0100
committerMarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz>2024-03-13 16:16:35 +0100
commitfa58550317c633c411009c1cc8fb692e3baf97e8 (patch)
tree8b7185c387bb78e3521102af96fe6390d361d145 /src/validation.cpp
parent264ca9db240158403f6b9076d2fd5ef2522c391b (diff)
downloadbitcoin-fa58550317c633c411009c1cc8fb692e3baf97e8.tar.xz
refactor: Modernize header sync logs
No change in behavior, only the modern aliases and types are used.
Diffstat (limited to 'src/validation.cpp')
-rw-r--r--src/validation.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 94d2680db7..a230010497 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -4188,9 +4188,9 @@ bool ChainstateManager::ProcessNewBlockHeaders(const std::vector<CBlockHeader>&
if (NotifyHeaderTip(*this)) {
if (IsInitialBlockDownload() && ppindex && *ppindex) {
const CBlockIndex& last_accepted{**ppindex};
- const int64_t blocks_left{(GetTime() - last_accepted.GetBlockTime()) / GetConsensus().nPowTargetSpacing};
+ int64_t blocks_left{(NodeClock::now() - last_accepted.Time()) / GetConsensus().PowTargetSpacing()};
const double progress{100.0 * last_accepted.nHeight / (last_accepted.nHeight + blocks_left)};
- LogPrintf("Synchronizing blockheaders, height: %d (~%.2f%%)\n", last_accepted.nHeight, progress);
+ LogInfo("Synchronizing blockheaders, height: %d (~%.2f%%)\n", last_accepted.nHeight, progress);
}
}
return true;
@@ -4214,9 +4214,9 @@ void ChainstateManager::ReportHeadersPresync(const arith_uint256& work, int64_t
bool initial_download = IsInitialBlockDownload();
GetNotifications().headerTip(GetSynchronizationState(initial_download), height, timestamp, /*presync=*/true);
if (initial_download) {
- const int64_t blocks_left{(GetTime() - timestamp) / GetConsensus().nPowTargetSpacing};
+ int64_t blocks_left{(NodeClock::now() - NodeSeconds{std::chrono::seconds{timestamp}}) / GetConsensus().PowTargetSpacing()};
const double progress{100.0 * height / (height + blocks_left)};
- LogPrintf("Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n", height, progress);
+ LogInfo("Pre-synchronizing blockheaders, height: %d (~%.2f%%)\n", height, progress);
}
}