From a378b59628514dd4c0543e3f20c3fa388e32e504 Mon Sep 17 00:00:00 2001 From: j-berman Date: Mon, 27 Oct 2025 17:14:16 -0700 Subject: [PATCH] tx pool: only increment m_txpool_weight for newly added pool txs Otherwise we can end up double counting txs towards the weight, which can over-state the pool weight. E.g. relay tx to node in stem phase, add its weight to pool weight, then receive tx from another node, then bump the pool weight again. That double counts the tx towards the pool weight. If the weight exceeds the max, the node will "prune" txs from the pool. Thus, over-counting is probably a cause of, but perhaps not the only cause of: https://github.com/seraphis-migration/monero/issues/148 --- src/cryptonote_core/tx_pool.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cryptonote_core/tx_pool.cpp b/src/cryptonote_core/tx_pool.cpp index c63465e4a..5039ab936 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -343,7 +343,8 @@ namespace cryptonote } tvc.m_verifivation_failed = false; - m_txpool_weight += tx_weight; + if (tvc.m_added_to_pool) + m_txpool_weight += tx_weight; ++m_cookie;