Skip to content

Commit ff2ad2d

Browse files
committed
Add missing newlines to LogPrint debug logging
The linter only checked `LogPrintf`, not `LogPrint`. Fix the remaining cases.
1 parent 598db38 commit ff2ad2d

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

src/net.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
395395
if (Lookup(pszDest, resolved, default_port, fNameLookup && !HaveNameProxy(), 256) && !resolved.empty()) {
396396
addrConnect = CAddress(resolved[GetRand(resolved.size())], NODE_NONE);
397397
if (!addrConnect.IsValid()) {
398-
LogPrint(BCLog::NET, "Resolver returned invalid address %s for %s", addrConnect.ToString(), pszDest);
398+
LogPrint(BCLog::NET, "Resolver returned invalid address %s for %s\n", addrConnect.ToString(), pszDest);
399399
return nullptr;
400400
}
401401
// It is possible that we already have a connection to the IP/port pszDest resolved to.

src/net_processing.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,7 +2059,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20592059

20602060
const CBlockIndex* pindex = LookupBlockIndex(req.blockhash);
20612061
if (!pindex || !(pindex->nStatus & BLOCK_HAVE_DATA)) {
2062-
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block we don't have", pfrom->GetId());
2062+
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block we don't have\n", pfrom->GetId());
20632063
return true;
20642064
}
20652065

@@ -2071,7 +2071,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
20712071
// might maliciously send lots of getblocktxn requests to trigger
20722072
// expensive disk reads, because it will require the peer to
20732073
// actually receive all the data read from disk over the network.
2074-
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block > %i deep", pfrom->GetId(), MAX_BLOCKTXN_DEPTH);
2074+
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block > %i deep\n", pfrom->GetId(), MAX_BLOCKTXN_DEPTH);
20752075
CInv inv;
20762076
inv.type = State(pfrom->GetId())->fWantsCmpctWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK;
20772077
inv.hash = req.blockhash;

src/rpc/blockchain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -940,7 +940,7 @@ UniValue pruneblockchain(const JSONRPCRequest& request)
940940
else if (height > chainHeight)
941941
throw JSONRPCError(RPC_INVALID_PARAMETER, "Blockchain is shorter than the attempted prune height.");
942942
else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) {
943-
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. Retaining the minimum number of blocks.");
943+
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. Retaining the minimum number of blocks.\n");
944944
height = chainHeight - MIN_BLOCKS_TO_KEEP;
945945
}
946946

src/timedata.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,9 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)
110110

111111
if (LogAcceptCategory(BCLog::NET)) {
112112
for (int64_t n : vSorted) {
113-
LogPrint(BCLog::NET, "%+d ", n);
113+
LogPrint(BCLog::NET, "%+d ", n); /* Continued */
114114
}
115-
LogPrint(BCLog::NET, "| ");
115+
LogPrint(BCLog::NET, "| "); /* Continued */
116116

117117
LogPrint(BCLog::NET, "nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset/60);
118118
}

src/wallet/coinselection.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,10 +286,10 @@ bool KnapsackSolver(const CAmount& nTargetValue, std::vector<CInputCoin>& vCoins
286286
}
287287

288288
if (LogAcceptCategory(BCLog::SELECTCOINS)) {
289-
LogPrint(BCLog::SELECTCOINS, "SelectCoins() best subset: ");
289+
LogPrint(BCLog::SELECTCOINS, "SelectCoins() best subset: "); /* Continued */
290290
for (unsigned int i = 0; i < vValue.size(); i++) {
291291
if (vfBest[i]) {
292-
LogPrint(BCLog::SELECTCOINS, "%s ", FormatMoney(vValue[i].txout.nValue));
292+
LogPrint(BCLog::SELECTCOINS, "%s ", FormatMoney(vValue[i].txout.nValue)); /* Continued */
293293
}
294294
}
295295
LogPrint(BCLog::SELECTCOINS, "total %s\n", FormatMoney(nBest));

0 commit comments

Comments
 (0)