aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-08-29 15:41:18 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-08-29 15:47:26 +0200
commit1f8378508acfc1f6ca48dcc75eb0848e82bb183d (patch)
treeaa6a5c3693606f85d0ba155a9d2016e192454a9c /src
parentd20d171f26c27c02dd2c77951fb65da84dbe4e11 (diff)
parentd75e704ac08fb43320e3ebcdde0d2a5392fdec9f (diff)
downloadbitcoin-1f8378508acfc1f6ca48dcc75eb0848e82bb183d.tar.xz
Merge #15615: Add log output during initial header sync
d75e704ac08fb43320e3ebcdde0d2a5392fdec9f Add log output during initial header sync (Jonas Schnelli) Pull request description: The non debug log output is completely quiet during the header sync. I see two main reasons to add infos about the state of the initial header sync... * users may think the node did fail to start sync * it's a little complicate to check if your getting throttled during header sync (repeatedly calling `getchaintips` or similar) ACKs for top commit: fanquake: Concept ACK https://github.com/bitcoin/bitcoin/pull/15615/commits/d75e704ac08fb43320e3ebcdde0d2a5392fdec9f practicalswift: utACK d75e704ac08fb43320e3ebcdde0d2a5392fdec9f laanwj: Tested ACK d75e704ac08fb43320e3ebcdde0d2a5392fdec9f Tree-SHA512: 2e738571b703d7251290864603c3a829729645962c2fa3187250bab0585e66a5f01fce892e9b5b98da451fab2b40a2e4784f9b2e5a9cad75ff62c535affe7430
Diffstat (limited to 'src')
-rw-r--r--src/validation.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index 74f68a3047..cd19d7666f 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -3401,6 +3401,12 @@ bool ProcessNewBlockHeaders(const std::vector<CBlockHeader>& headers, CValidatio
}
}
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);
+ }
+ }
return true;
}