aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-09-13 15:23:57 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-09-13 15:32:20 +0200
commitfb4f5beb6ede4aadeaff779cd67a0f6665419488 (patch)
tree5f03e886a0ec2809cd2ad4bf94038302b6c20689
parent102998ea03f64641495e03c9b93f73031bee9438 (diff)
parentf390d8556ba3db91d9e9e73a48459954584b9058 (diff)
Merge #16854: Prevent UpdateTip log message from being broken up
f390d8556ba3db91d9e9e73a48459954584b9058 Prevent UpdateTip log message from being broken up (Steven Roose) Pull request description: We had some occurrences of log messages colliding: ``` $ grep ThreadRPC $(find . -type f -name debug.log -print | grep bitcoind.datadir ) | awk '{$1=""; print $0}' | sort -u ThreadRPCServer method=sendrawtransaction user=bitcoinrpc ThreadRPCServer method=sendtoaddress user=bitcoinrpc ThreadRPCServer method=signrawtransactionwithkey user=bitcoinrpc UpdateTip: new best=0026711b58616e8d4db7d9bc9f46b746ec535521feb3e0f077e83925e45daa8a height=630 version=0x20000000 log2_work=10.301496 tx=633 date='2019-09-10T00:43:41Z' progress=1.000000 cache=0.1MiB(811txo)ThreadRPCServer method=getblockheader user=bitcoinrpc UpdateTip: new best=466304b9c3ed652373d30207f0d99551c568c2dbc648518c077cb40826039e5f height=643 version=0x20000000 log2_work=10.330917 tx=647 date='2019-09-10T00:43:43Z' progress=1.000000 cache=0.1MiB(915txo)ThreadRPCServer method=getblockheader user=bitcoinrpc ``` ACKs for top commit: jonasschnelli: utACK f390d8556ba3db91d9e9e73a48459954584b9058 laanwj: ACK f390d8556ba3db91d9e9e73a48459954584b9058 Tree-SHA512: 15f9836d6cac171fc2b7a36a65ea8db77727559e5a558114e8c767bf059b20067afa7d6a88cfc365e9f5fa21ab5bc462d92fd01997a299fa8ed1f5c1046d1ba6
-rw-r--r--src/validation.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/validation.cpp b/src/validation.cpp
index d470fd5b6e..49b05f350a 100644
--- a/src/validation.cpp
+++ b/src/validation.cpp
@@ -2240,14 +2240,12 @@ void static UpdateTip(const CBlockIndex* pindexNew, const CChainParams& chainPar
if (nUpgraded > 0)
AppendWarning(warningMessages, strprintf(_("%d of last 100 blocks have unexpected version").translated, nUpgraded));
}
- LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__, /* Continued */
+ LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)%s\n", __func__,
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,
FormatISO8601DateTime(pindexNew->GetBlockTime()),
- GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize());
- if (!warningMessages.empty())
- LogPrintf(" warning='%s'", warningMessages); /* Continued */
- LogPrintf("\n");
+ GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
+ !warningMessages.empty() ? strprintf(" warning='%s'", warningMessages) : "");
}