aboutsummaryrefslogtreecommitdiff
path: root/src/txmempool.cpp
diff options
context:
space:
mode:
author251 <13120787+l2a5b1@users.noreply.github.com>2019-07-23 23:47:17 +0200
committer251 <13120787+l2a5b1@users.noreply.github.com>2019-11-21 21:05:38 +0100
commite20c72f9f076681def325b5b5fa53bccda2b0eab (patch)
treef88c796738d7379600782ac143e24a0f922fca45 /src/txmempool.cpp
parent69a6f1ad1f7ca52b2524ab8322bfa89a9b0ee61b (diff)
downloadbitcoin-e20c72f9f076681def325b5b5fa53bccda2b0eab.tar.xz
Fire TransactionRemovedFromMempool from mempool
This commit fires TransactionRemovedFromMempool callbacks from the mempool and cleans up a bunch of code.
Diffstat (limited to 'src/txmempool.cpp')
-rw-r--r--src/txmempool.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/txmempool.cpp b/src/txmempool.cpp
index 08f935c24f..3c967a04c0 100644
--- a/src/txmempool.cpp
+++ b/src/txmempool.cpp
@@ -17,6 +17,7 @@
#include <util/system.h>
#include <util/moneystr.h>
#include <util/time.h>
+#include <validationinterface.h>
CTxMemPoolEntry::CTxMemPoolEntry(const CTransactionRef& _tx, const CAmount& _nFee,
int64_t _nTime, unsigned int _entryHeight,
@@ -403,7 +404,12 @@ void CTxMemPool::addUnchecked(const CTxMemPoolEntry &entry, setEntries &setAnces
void CTxMemPool::removeUnchecked(txiter it, MemPoolRemovalReason reason)
{
- NotifyEntryRemoved(it->GetSharedTx(), reason);
+ CTransactionRef ptx = it->GetSharedTx();
+ NotifyEntryRemoved(ptx, reason);
+ if (reason != MemPoolRemovalReason::BLOCK && reason != MemPoolRemovalReason::CONFLICT) {
+ GetMainSignals().TransactionRemovedFromMempool(ptx);
+ }
+
const uint256 hash = it->GetTx().GetHash();
for (const CTxIn& txin : it->GetTx().vin)
mapNextTx.erase(txin.prevout);