From e57980b4738c10344baf136de3e050a3cb958ca5 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Mon, 11 Nov 2019 10:53:03 -0500 Subject: [mempool] Remove NotifyEntryAdded and NotifyEntryRemoved callbacks NotifyEntryAdded never had any subscribers so can be removed. Since ConnectTrace no longer subscribes to NotifyEntryRemoved, there are now no subscribers. The CValidationInterface TransactionAddedToMempool and TransactionRemovedFromMempool methods can now provide this functionality. There's no need for a special notifications framework for the mempool. --- src/txmempool.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/txmempool.cpp') diff --git a/src/txmempool.cpp b/src/txmempool.cpp index f04f13e6e0..47b0d39ea4 100644 --- a/src/txmempool.cpp +++ b/src/txmempool.cpp @@ -355,7 +355,6 @@ void CTxMemPool::AddTransactionsUpdated(unsigned int n) void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAncestors, bool validFeeEstimate) { - NotifyEntryAdded(entry.GetSharedTx()); // Add to memory pool without checking anything. // Used by AcceptToMemoryPool(), which DOES do // all the appropriate checks. @@ -406,14 +405,12 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason) { - CTransactionRef ptx = it->GetSharedTx(); - NotifyEntryRemoved(ptx, reason); if (reason != MemPoolRemovalReason::BLOCK) { // Notify clients that a transaction has been removed from the mempool // for any reason except being included in a block. Clients interested // in transactions included in blocks can subscribe to the BlockConnected // notification. - GetMainSignals().TransactionRemovedFromMempool(ptx); + GetMainSignals().TransactionRemovedFromMempool(it->GetSharedTx()); } const uint256 hash = it->GetTx().GetHash(); -- cgit v1.2.3