Skip to content

Commit

Permalink
fix LogPrintf lint fails
Browse files Browse the repository at this point in the history
  • Loading branch information
backpacker69 committed Feb 26, 2019
1 parent b5d5bb3 commit 1459018
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/dbwrapper.cpp
Expand Up @@ -63,7 +63,7 @@ class CBitcoinLevelDBLogger : public leveldb::Logger {

assert(p <= limit);
base[std::min(bufsize - 1, (int)(p - base))] = '\0';
LogPrintf("leveldb: %s", base);
LogPrintf("leveldb: %s", base); /* Continued */
if (base != buffer) {
delete[] base;
}
Expand Down
8 changes: 4 additions & 4 deletions src/init.cpp
Expand Up @@ -1143,9 +1143,9 @@ bool AppInitMain()

// Warn about relative -datadir path.
if (gArgs.IsArgSet("-datadir") && !fs::path(gArgs.GetArg("-datadir", "")).is_absolute()) {
LogPrintf("Warning: relative datadir option '%s' specified, which will be interpreted relative to the "
"current working directory '%s'. This is fragile, because if peercoin is started in the future "
"from a different location, it will be unable to locate the current data files. There could "
LogPrintf("Warning: relative datadir option '%s' specified, which will be interpreted relative to the " /* Continued */
"current working directory '%s'. This is fragile, because if peercoin is started in the future " /* Continued */
"from a different location, it will be unable to locate the current data files. There could " /* Continued */
"also be data loss if peercoin is started while in a temporary directory.\n",
gArgs.GetArg("-datadir", ""), fs::current_path().string());
}
Expand Down Expand Up @@ -1447,7 +1447,7 @@ bool AppInitMain()
if (!is_coinsview_empty) {
uiInterface.InitMessage(_("Verifying blocks..."));
if (fHavePruned && gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > MIN_BLOCKS_TO_KEEP) {
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks",
LogPrintf("Prune: pruned datadir may not have more than %d blocks; only checking available blocks\n",
MIN_BLOCKS_TO_KEEP);
}

Expand Down
2 changes: 1 addition & 1 deletion src/kernel.cpp
Expand Up @@ -638,7 +638,7 @@ unsigned int GetStakeEntropyBit(const CBlock& block)
// old protocol for entropy bit pre v0.4
uint160 hashSig = Hash160(block.vchBlockSig);
if (gArgs.GetBoolArg("-printstakemodifier", false))
LogPrintf("GetStakeEntropyBit(v0.3): nTime=%u hashSig=%s", block.nTime, hashSig.ToString());
LogPrintf("GetStakeEntropyBit(v0.3): nTime=%u hashSig=%s", block.nTime, hashSig.ToString()); /* Continued */
nEntropyBit = hashSig.GetDataPtr()[4] >> 31; // take the first bit of the hash
if (gArgs.GetBoolArg("-printstakemodifier", false))
LogPrintf(" entropybit=%d\n", nEntropyBit);
Expand Down
2 changes: 1 addition & 1 deletion src/miner.cpp
Expand Up @@ -589,7 +589,7 @@ void PoSMiner(CWallet *pwallet)
{
if (!SignBlock(*pblock, *pwallet))
{
LogPrintf("PoSMiner(): failed to sign PoS block");
LogPrintf("PoSMiner(): failed to sign PoS block\n");
continue;
}
LogPrintf("CPUMiner : proof-of-stake block found %s\n", pblock->GetHash().ToString());
Expand Down
2 changes: 1 addition & 1 deletion src/net.cpp
Expand Up @@ -391,7 +391,7 @@ CNode* CConnman::ConnectNode(CAddress addrConnect, const char *pszDest, bool fCo
if (Lookup(pszDest, resolved, default_port, fNameLookup && !HaveNameProxy(), 256) && !resolved.empty()) {
addrConnect = CAddress(resolved[GetRand(resolved.size())], NODE_NONE);
if (!addrConnect.IsValid()) {
LogPrint(BCLog::NET, "Resolver returned invalid address %s for %s", addrConnect.ToString(), pszDest);
LogPrint(BCLog::NET, "Resolver returned invalid address %s for %s\n", addrConnect.ToString(), pszDest);
return nullptr;
}
// It is possible that we already have a connection to the IP/port pszDest resolved to.
Expand Down
6 changes: 3 additions & 3 deletions src/net_processing.cpp
Expand Up @@ -1271,7 +1271,7 @@ inline void static SendBlockTransactions(const CBlock& block, const BlockTransac
if (req.indexes[i] >= block.vtx.size()) {
LOCK(cs_main);
Misbehaving(pfrom->GetId(), 100);
LogPrintf("Peer %d sent us a getblocktxn with out-of-bounds tx indices", pfrom->GetId());
LogPrintf("Peer %d sent us a getblocktxn with out-of-bounds tx indices\n", pfrom->GetId());
return;
}
resp.txn[i] = block.vtx[req.indexes[i]];
Expand Down Expand Up @@ -2056,7 +2056,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr

BlockMap::iterator it = mapBlockIndex.find(req.blockhash);
if (it == mapBlockIndex.end() || !(it->second->nStatus & BLOCK_HAVE_DATA)) {
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block we don't have", pfrom->GetId());
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block we don't have\n", pfrom->GetId());
return true;
}

Expand All @@ -2068,7 +2068,7 @@ bool static ProcessMessage(CNode* pfrom, const std::string& strCommand, CDataStr
// might maliciously send lots of getblocktxn requests to trigger
// expensive disk reads, because it will require the peer to
// actually receive all the data read from disk over the network.
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block > %i deep", pfrom->GetId(), MAX_BLOCKTXN_DEPTH);
LogPrint(BCLog::NET, "Peer %d sent us a getblocktxn for a block > %i deep\n", pfrom->GetId(), MAX_BLOCKTXN_DEPTH);
CInv inv;
inv.type = State(pfrom->GetId())->fWantsCmpctWitness ? MSG_WITNESS_BLOCK : MSG_BLOCK;
inv.hash = req.blockhash;
Expand Down
2 changes: 1 addition & 1 deletion src/rpc/blockchain.cpp
Expand Up @@ -921,7 +921,7 @@ UniValue pruneblockchain(const JSONRPCRequest& request)
else if (height > chainHeight)
throw JSONRPCError(RPC_INVALID_PARAMETER, "Blockchain is shorter than the attempted prune height.");
else if (height > chainHeight - MIN_BLOCKS_TO_KEEP) {
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. Retaining the minimum number of blocks.");
LogPrint(BCLog::RPC, "Attempt to prune blocks close to the tip. Retaining the minimum number of blocks.\n");
height = chainHeight - MIN_BLOCKS_TO_KEEP;
}

Expand Down
8 changes: 4 additions & 4 deletions src/sync.cpp
Expand Up @@ -81,20 +81,20 @@ static void potential_deadlock_detected(const std::pair<void*, void*>& mismatch,
LogPrintf("Previous lock order was:\n");
for (const std::pair<void*, CLockLocation> & i : s2) {
if (i.first == mismatch.first) {
LogPrintf(" (1)");
LogPrintf(" (1)"); /* Continued */
}
if (i.first == mismatch.second) {
LogPrintf(" (2)");
LogPrintf(" (2)"); /* Continued */
}
LogPrintf(" %s\n", i.second.ToString());
}
LogPrintf("Current lock order is:\n");
for (const std::pair<void*, CLockLocation> & i : s1) {
if (i.first == mismatch.first) {
LogPrintf(" (1)");
LogPrintf(" (1)"); /* Continued */
}
if (i.first == mismatch.second) {
LogPrintf(" (2)");
LogPrintf(" (2)"); /* Continued */
}
LogPrintf(" %s\n", i.second.ToString());
}
Expand Down
4 changes: 2 additions & 2 deletions src/timedata.cpp
Expand Up @@ -110,9 +110,9 @@ void AddTimeData(const CNetAddr& ip, int64_t nOffsetSample)

if (LogAcceptCategory(BCLog::NET)) {
for (int64_t n : vSorted) {
LogPrint(BCLog::NET, "%+d ", n);
LogPrint(BCLog::NET, "%+d ", n); /* Continued */
}
LogPrint(BCLog::NET, "| ");
LogPrint(BCLog::NET, "| "); /* Continued */

LogPrint(BCLog::NET, "nTimeOffset = %+d (%+d minutes)\n", nTimeOffset, nTimeOffset/60);
}
Expand Down
4 changes: 2 additions & 2 deletions src/txdb.cpp
Expand Up @@ -385,7 +385,7 @@ bool CCoinsViewDB::Upgrade() {

int64_t count = 0;
LogPrintf("Upgrading utxo-set database...\n");
LogPrintf("[0%%]...");
LogPrintf("[0%%]..."); /* Continued */
uiInterface.ShowProgress(_("Upgrading UTXO database"), 0, true);
size_t batch_size = 1 << 24;
CDBBatch batch(db);
Expand All @@ -404,7 +404,7 @@ bool CCoinsViewDB::Upgrade() {
uiInterface.ShowProgress(_("Upgrading UTXO database"), percentageDone, true);
if (reportDone < percentageDone/10) {
// report max. every 10% step
LogPrintf("[%d%%]...", percentageDone);
LogPrintf("[%d%%]...", percentageDone); /* Continued */
reportDone = percentageDone/10;
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/validation.cpp
Expand Up @@ -2030,15 +2030,15 @@ void static UpdateTip(const CBlockIndex *pindexNew, const CChainParams& chainPar
strCheckpointWarning = "";
}

LogPrintf("%s: new best=%s height=%d version=0x%08x log2_trust=%.8g moneysupply=%s tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__,
LogPrintf("%s: new best=%s height=%d version=0x%08x log2_trust=%.8g moneysupply=%s tx=%lu date='%s' progress=%f cache=%.1fMiB(%utxo)", __func__, /* Continued */
pindexNew->GetBlockHash().ToString(), pindexNew->nHeight, pindexNew->nVersion,
log(pindexNew->nChainTrust.getdouble())/log(2.0),
FormatMoney(pindexNew->nMoneySupply),
(unsigned long)pindexNew->nChainTx,
DateTimeStrFormat("%Y-%m-%d %H:%M:%S", pindexNew->GetBlockTime()),
GuessVerificationProgress(chainParams.TxData(), pindexNew), pcoinsTip->DynamicMemoryUsage() * (1.0 / (1<<20)), pcoinsTip->GetCacheSize());
if (!warningMessages.empty())
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", "));
LogPrintf(" warning='%s'", boost::algorithm::join(warningMessages, ", ")); /* Continued */
LogPrintf("\n");

}
Expand Down Expand Up @@ -3823,14 +3823,14 @@ bool CVerifyDB::VerifyDB(const CChainParams& chainparams, CCoinsView *coinsview,
int nGoodTransactions = 0;
CValidationState state;
int reportDone = 0;
LogPrintf("[0%%]...");
LogPrintf("[0%%]..."); /* Continued */
for (CBlockIndex* pindex = chainActive.Tip(); pindex && pindex->pprev; pindex = pindex->pprev)
{
boost::this_thread::interruption_point();
int percentageDone = std::max(1, std::min(99, (int)(((double)(chainActive.Height() - pindex->nHeight)) / (double)nCheckDepth * (nCheckLevel >= 4 ? 50 : 100))));
if (reportDone < percentageDone/10) {
// report every 10% step
LogPrintf("[%d%%]...", percentageDone);
LogPrintf("[%d%%]...", percentageDone); /* Continued */
reportDone = percentageDone/10;
}
uiInterface.ShowProgress(_("Verifying blocks..."), percentageDone, false);
Expand Down
6 changes: 3 additions & 3 deletions src/wallet/wallet.cpp
Expand Up @@ -2483,10 +2483,10 @@ bool CWallet::SelectCoinsMinConf(const CAmount& nTargetValue, const int nConfMin
}

if (LogAcceptCategory(BCLog::SELECTCOINS)) {
LogPrint(BCLog::SELECTCOINS, "SelectCoins() best subset: ");
LogPrint(BCLog::SELECTCOINS, "SelectCoins() best subset: "); /* Continued */
for (unsigned int i = 0; i < vValue.size(); i++) {
if (vfBest[i]) {
LogPrint(BCLog::SELECTCOINS, "%s ", FormatMoney(vValue[i].txout.nValue));
LogPrint(BCLog::SELECTCOINS, "%s ", FormatMoney(vValue[i].txout.nValue)); /* Continued */
}
}
LogPrint(BCLog::SELECTCOINS, "total %s\n", FormatMoney(nBest));
Expand Down Expand Up @@ -3020,7 +3020,7 @@ bool CWallet::CommitTransaction(CWalletTx& wtxNew, CReserveKey& reservekey, CCon
{
{
LOCK2(cs_main, cs_wallet);
LogPrintf("CommitTransaction:\n%s", wtxNew.tx->ToString());
LogPrintf("CommitTransaction: %s\n", wtxNew.tx->ToString());
{
// Take key pair from key pool so it won't be used again
reservekey.KeepKey();
Expand Down

0 comments on commit 1459018

Please sign in to comment.