aboutsummaryrefslogtreecommitdiff
path: root/src/net_processing.cpp
diff options
context:
space:
mode:
authorchinggg <24590067+chinggg@users.noreply.github.com>2022-07-23 20:51:07 +0800
committerchinggg <24590067+chinggg@users.noreply.github.com>2022-07-28 14:39:45 +0800
commitb4b657ba57a2ce31b3c21ea9245aad26d5b06a57 (patch)
tree8fb1b9db0e88fda2087ed13b34450ac22bce6565 /src/net_processing.cpp
parent194f6dc43ccc330a8a4607be3a2b8935490d6db0 (diff)
downloadbitcoin-b4b657ba57a2ce31b3c21ea9245aad26d5b06a57.tar.xz
refactor: log `nEvicted` message in `LimitOrphans` then return void
`LimitOrphans()` can log expired tx and it should log evicted tx as well instead of returning the number for caller to print the message. Since `LimitOrphans()` now return void, the redundant assertion check in fuzz test is also removed.
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r--src/net_processing.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp
index 74d1bf44d2..a845be9e62 100644
--- a/src/net_processing.cpp
+++ b/src/net_processing.cpp
@@ -3630,10 +3630,7 @@ void PeerManagerImpl::ProcessMessage(CNode& pfrom, const std::string& msg_type,
// DoS prevention: do not allow m_orphanage to grow unbounded (see CVE-2012-3789)
unsigned int nMaxOrphanTx = (unsigned int)std::max((int64_t)0, gArgs.GetIntArg("-maxorphantx", DEFAULT_MAX_ORPHAN_TRANSACTIONS));
- unsigned int nEvicted = m_orphanage.LimitOrphans(nMaxOrphanTx);
- if (nEvicted > 0) {
- LogPrint(BCLog::MEMPOOL, "orphanage overflow, removed %u tx\n", nEvicted);
- }
+ m_orphanage.LimitOrphans(nMaxOrphanTx);
} else {
LogPrint(BCLog::MEMPOOL, "not keeping orphan with rejected parents %s\n",tx.GetHash().ToString());
// We will continue to reject this tx since it has rejected