Merge 60f142e395 into merged_master (Bitcoin PR bitcoin/bitcoin#26531)

This commit is contained in:
Thomas Trevethan 2025-04-11 14:45:16 +01:00
commit b49bfac365
7 changed files with 845 additions and 0 deletions

View file

@ -24,6 +24,7 @@
#include <util/result.h>
#include <util/system.h>
#include <util/time.h>
#include <util/trace.h>
#include <util/translation.h>
#include <validationinterface.h>
@ -473,6 +474,12 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
vTxHashes.emplace_back(tx.GetWitnessHash(), newit);
newit->vTxHashesIdx = vTxHashes.size() - 1;
TRACE3(mempool, added,
entry.GetTx().GetHash().data(),
entry.GetTxSize(),
entry.GetFee()
);
}
void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
@ -488,6 +495,13 @@ void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
// notification.
GetMainSignals().TransactionRemovedFromMempool(it->GetSharedTx(), reason, mempool_sequence);
}
TRACE5(mempool, removed,
it->GetTx().GetHash().data(),
RemovalReasonToString(reason).c_str(),
it->GetTxSize(),
it->GetFee(),
std::chrono::duration_cast<std::chrono::duration<std::uint64_t>>(it->GetTime()).count()
);
const uint256 hash = it->GetTx().GetHash();
for (const CTxIn& txin : it->GetTx().vin)