diff options
| author | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:31:22 +0000 |
|---|---|---|
| committer | bitflash-maintainer <noreply@bitflash.invalid> | 2026-09-02 05:31:22 +0000 |
| commit | 2661de141e46dadfb2903bb12e72dc87c5a64375 (patch) | |
| tree | 73f5492187a1da4b362463834983ad767f105306 /src/main.cpp | |
| parent | ae1c6a7b49d9b4f8cf7218c0baec84f348eb5ef6 (diff) | |
log: demote the four lines that were 90% of debug.log behind /debugrelay
A 13-hour production capture was ~71% "sending: tx", ~16% "Nostr:
discovered .btf peer", ~5% "Relaying wtx", and ~43% of raw lines were
CBlock/CTransaction dumps -- all already under -debug, which operators
run permanently, so -debug was useless as a filter.
The category mechanism gains a verbose tier: "relay" and
"nostrdiscovery" are accepted only with the new /debugrelay flag (which
implies /debug); everything else keeps its current gate. Demoted, with
message text unchanged for anyone grepping it:
net.h "sending: tx (N bytes)" (BeginMessage/EndMessage/
AbortMessage all pick the category from the command, so no
orphaned "(N bytes)" fragments leak into a plain -debug log)
main.cpp "Relaying wtx", "received block:" + CBlock::print, and the
BitcoinMiner block dump
nostr.cpp "Nostr: discovered .btf peer" -> "nostrdiscovery"
Pool/worker/payout, [payout], BLOCK ORPHANED/ACCEPTED and share flow
lines are untouched. Because LogPrint dedup keys on category, demoted
lines also keep their burst collapse under /debugrelay.
Closes #35
Diffstat (limited to 'src/main.cpp')
| -rw-r--r-- | src/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp index 7b3e555..80f5f31 100644 --- a/src/main.cpp +++ b/src/main.cpp | |||
| @@ -1712,7 +1712,7 @@ void CWalletTx::RelayWalletTransaction(CTxDB& txdb) | |||
| 1712 | uint256 hash = GetHash(); | 1712 | uint256 hash = GetHash(); |
| 1713 | if (!txdb.ContainsTx(hash)) | 1713 | if (!txdb.ContainsTx(hash)) |
| 1714 | { | 1714 | { |
| 1715 | if (LogAcceptsCategory("net")) printf("Relaying wtx %s\n", hash.ToString().substr(0,6).c_str()); | 1715 | if (LogAcceptsCategory("relay")) printf("Relaying wtx %s\n", hash.ToString().substr(0,6).c_str()); |
| 1716 | RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this); | 1716 | RelayMessage(CInv(MSG_TX, hash), (CTransaction)*this); |
| 1717 | } | 1717 | } |
| 1718 | } | 1718 | } |
| @@ -3263,7 +3263,7 @@ bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv) | |||
| 3263 | vRecv >> *pblock; | 3263 | vRecv >> *pblock; |
| 3264 | 3264 | ||
| 3265 | //// debug print | 3265 | //// debug print |
| 3266 | if (LogAcceptsCategory("net")) { printf("received block:\n"); pblock->print(); } | 3266 | if (LogAcceptsCategory("relay")) { printf("received block:\n"); pblock->print(); } |
| 3267 | 3267 | ||
| 3268 | CInv inv(MSG_BLOCK, pblock->GetHash()); | 3268 | CInv inv(MSG_BLOCK, pblock->GetHash()); |
| 3269 | pfrom->AddInventoryKnown(inv); | 3269 | pfrom->AddInventoryKnown(inv); |
| @@ -4555,7 +4555,7 @@ bool BitcoinMiner(int nThreadId) | |||
| 4555 | //// debug print | 4555 | //// debug print |
| 4556 | if (LogAcceptsCategory("net")) printf("BitcoinMiner:\n"); | 4556 | if (LogAcceptsCategory("net")) printf("BitcoinMiner:\n"); |
| 4557 | if (LogAcceptsCategory("net")) printf("RandomX proof-of-work found \n powhash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str()); | 4557 | if (LogAcceptsCategory("net")) printf("RandomX proof-of-work found \n powhash: %s \ntarget: %s\n", hash.GetHex().c_str(), hashTarget.GetHex().c_str()); |
| 4558 | if (LogAcceptsCategory("net")) pblock->print(); | 4558 | if (LogAcceptsCategory("relay")) pblock->print(); |
| 4559 | 4559 | ||
| 4560 | SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); | 4560 | SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_NORMAL); |
| 4561 | CRITICAL_BLOCK(cs_main) | 4561 | CRITICAL_BLOCK(cs_main) |