From cbf9b2dab1d8800d63d65904ccfd64e1e439e510 Mon Sep 17 00:00:00 2001 From: Cory Fields Date: Tue, 10 Jun 2025 20:52:46 +0000 Subject: [PATCH] mempool: codify existing assumption about duplicate txids during removal Also explicitly check for txid equality rather than transaction equality as the former is a tighter constraint if witness data is included when comparing the full transactions. Co-authored-by: glozow --- src/txmempool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/txmempool.cpp b/src/txmempool.cpp index 3a5a3fb306d..10ff535828a 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -652,7 +652,7 @@ void CTxMemPool::removeConflicts(const CTransaction &tx) auto it = mapNextTx.find(txin.prevout); if (it != mapNextTx.end()) { const CTransaction &txConflict = *it->second; - if (txConflict != tx) + if (Assume(txConflict.GetHash() != tx.GetHash())) { ClearPrioritisation(txConflict.GetHash()); removeRecursive(txConflict, MemPoolRemovalReason::CONFLICT);