Skip to content

Commit 0772a68

Browse files
committed
Reduce log spam
New debug category "staking" added with some previous `LogPrintf` messages recategorized to reduce log spam. Also noted both "staking" and "precompute" in the init help message and added them to the "pivx" umbrella category.
1 parent d367d5d commit 0772a68

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

src/init.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,7 @@ std::string HelpMessage(HelpMessageMode mode)
500500
strUsage += HelpMessageOpt("-stopafterblockimport", strprintf(_("Stop running after importing blocks from disk (default: %u)"), 0));
501501
strUsage += HelpMessageOpt("-sporkkey=<privkey>", _("Enable spork administration functionality with the appropriate private key."));
502502
}
503-
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, pivx, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero)"; // Don't translate these and qt below
503+
string debugCategories = "addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, tor, mempool, net, proxy, http, libevent, pivx, (obfuscation, swiftx, masternode, mnpayments, mnbudget, zero, precompute, staking)"; // Don't translate these and qt below
504504
if (mode == HMM_BITCOIN_QT)
505505
debugCategories += ", qt";
506506
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +

src/miner.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn, CWallet* pwallet,
165165
}
166166

167167
if (!fStakeFound) {
168-
LogPrintf("CreateNewBlock(): stake not found\n");
168+
LogPrint("staking", "CreateNewBlock(): stake not found\n");
169169
return NULL;
170170
}
171171
}

src/util.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,8 @@ bool LogAcceptCategory(const char* category)
244244
ptrCategory->insert(string("mnpayments"));
245245
ptrCategory->insert(string("zero"));
246246
ptrCategory->insert(string("mnbudget"));
247+
ptrCategory->insert(string("precompute"));
248+
ptrCategory->insert(string("staking"));
247249
}
248250
}
249251
const set<string>& setCategories = *ptrCategory.get();

src/wallet.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3001,7 +3001,7 @@ bool CWallet::CreateCoinStake(
30013001
}
30023002

30033003
if (listInputs.empty()) {
3004-
LogPrintf("CreateCoinStake(): listInputs empty\n");
3004+
LogPrint("staking", "CreateCoinStake(): listInputs empty\n");
30053005
MilliSleep(50000);
30063006
return false;
30073007
}
@@ -3106,7 +3106,7 @@ bool CWallet::CreateCoinStake(
31063106
if (fKernelFound)
31073107
break; // if kernel is found stop searching
31083108
}
3109-
LogPrintf("%s: attempted staking %d times\n", __func__, nAttempts);
3109+
LogPrint("staking", "%s: attempted staking %d times\n", __func__, nAttempts);
31103110

31113111
if (!fKernelFound)
31123112
return false;

0 commit comments

Comments
 (0)