Skip to content

Commit fb4f5be

Browse files
committed
Merge #16854: Prevent UpdateTip log message from being broken up
f390d85 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 f390d85 laanwj: ACK f390d85 Tree-SHA512: 15f9836d6cac171fc2b7a36a65ea8db77727559e5a558114e8c767bf059b20067afa7d6a88cfc365e9f5fa21ab5bc462d92fd01997a299fa8ed1f5c1046d1ba6
2 parents 102998e + f390d85 commit fb4f5be

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/validation.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2240,14 +2240,12 @@ void static UpdateTip(const CBlockIndex* pindexNew, const CChainParams& chainPar
22402240
if (nUpgraded > 0)
22412241
AppendWarning(warningMessages, strprintf(_("%d of last 100 blocks have unexpected version").translated, nUpgraded));
22422242
}
2243-
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_work=%.8g tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__, /* Continued */
2243+
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__,
22442244
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
22452245
log(pindexNew->nChainWork.getdouble())/log(2.0), (unsigned long)pindexNew->nChainTx,
22462246
FormatISO8601DateTime(pindexNew->GetBlockTime()),
2247-
GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize());
2248-
if (!warningMessages.empty())
2249-
LogPrintf(" warning='%s'", warningMessages); /* Continued */
2250-
LogPrintf("\n");
2247+
GuessVerificationProgress(chainParams.TxData(), pindexNew), ::ChainstateActive().CoinsTip().DynamicMemoryUsage() * (1.0 / (1<<20)), ::ChainstateActive().CoinsTip().GetCacheSize(),
2248+
!warningMessages.empty() ? strprintf(" warning='%s'", warningMessages) : "");
22512249

22522250
}
22532251

0 commit comments

Comments
 (0)