diff options
author | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-08-31 21:59:04 +0200 |
---|---|---|
committer | Jonas Schnelli <dev@jonasschnelli.ch> | 2019-08-31 22:00:35 +0200 |
commit | dcc448e3d2b97f7e4e23f5ed174762cec3530306 (patch) | |
tree | 03d1e9a8569eaff5ddffc535348ab0e7d6c6ceba | |
parent | 495db72ee7d8c8302d357cb10d2bc2df18b9a5e0 (diff) |
Avoid unnecessary "Synchronizing blockheaders" log messages
-rw-r--r-- | src/validation.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/validation.cpp b/src/validation.cpp index cd19d7666f..04aad98380 100644 --- a/src/validation.cpp +++ b/src/validation.cpp @@ -2561,7 +2561,7 @@ bool CChainState::ActivateBestChainStep(CValidationState& state, const CChainPar return true; } -static void NotifyHeaderTip() LOCKS_EXCLUDED(cs_main) { +static bool NotifyHeaderTip() LOCKS_EXCLUDED(cs_main) { bool fNotify = false; bool fInitialBlockDownload = false; static CBlockIndex* pindexHeaderOld = nullptr; @@ -2580,6 +2580,7 @@ static void NotifyHeaderTip() LOCKS_EXCLUDED(cs_main) { if (fNotify) { uiInterface.NotifyHeaderTip(fInitialBlockDownload, pindexHeader); } + return fNotify; } static void LimitValidationInterfaceQueue() LOCKS_EXCLUDED(cs_main) { @@ -3400,8 +3401,7 @@ bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidatio } } } - NotifyHeaderTip(); - { + if (NotifyHeaderTip()) { LOCK(cs_main); if (::ChainstateActive().IsInitialBlockDownload() && ppindex && *ppindex) { LogPrintf("Synchronizing blockheaders, height: %d (~%.2f%%)\n", (*ppindex)->nHeight, 100.0/((*ppindex)->nHeight+(GetAdjustedTime() - (*ppindex)->GetBlockTime()) / Params().GetConsensus().nPowTargetSpacing) * (*ppindex)->nHeight); |