From bb3fbddb623859f8cbb0b66ec8bce6b90bae1508 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 (cherry picked from commit 90dad18bfbe3275142e2f3fe33017cd65486a20f) --- 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 81922206d..306214571 100644 --- a/src/cryptonote_core/tx_pool.cpp +++ b/src/cryptonote_core/tx_pool.cpp @@ -344,7 +344,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;