diff options
author | MacroFake <falke.marco@gmail.com> | 2022-07-29 16:16:23 +0200 |
---|---|---|
committer | MacroFake <falke.marco@gmail.com> | 2022-07-29 16:17:16 +0200 |
commit | b1c8ea45c9e0b658c86ed0bbbf6e0fe44cd40f1c (patch) | |
tree | 803b238a23ac4d4b6c191b015390bcb50d22545e /src/net_processing.cpp | |
parent | 1abbae65eb9c99df5d8941008068d83ad99bf117 (diff) | |
parent | b4b657ba57a2ce31b3c21ea9245aad26d5b06a57 (diff) |
Merge bitcoin/bitcoin#25683: refactor: log `nEvicted` message in `LimitOrphans` then return void
b4b657ba57a2ce31b3c21ea9245aad26d5b06a57 refactor: log `nEvicted` message in `LimitOrphans` then return void (chinggg)
Pull request description:
Fix https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=49347
LimitOrphans() can log expired tx and it should log evicted tx as well instead of returning the `nEvicted` number for caller to print the message.
Since `LimitOrphans()` now returns void, the redundant assertion check in fuzz test is also removed.
Top commit has no ACKs.
Tree-SHA512: 18c41702321b0e59812590cd389f3163831d431f4ebdc3b3e1e0698496a6bdbac52288f28f779237a58813c6717da1a35e8933d509822978ff726c1b13cfc778
Diffstat (limited to 'src/net_processing.cpp')
-rw-r--r-- | src/net_processing.cpp | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/net_processing.cpp b/src/net_processing.cpp index 7507b8ebca..0e10fa5f9d 100644 --- a/src/net_processing.cpp +++ b/src/net_processing.cpp @@ -3631,10 +3631,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 |