diff options
author | 251 <13120787+l2a5b1@users.noreply.github.com> | 2019-07-23 23:47:17 +0200 |
---|---|---|
committer | 251 <13120787+l2a5b1@users.noreply.github.com> | 2019-11-21 21:05:38 +0100 |
commit | e20c72f9f076681def325b5b5fa53bccda2b0eab (patch) | |
tree | f88c796738d7379600782ac143e24a0f922fca45 /src/txmempool.cpp | |
parent | 69a6f1ad1f7ca52b2524ab8322bfa89a9b0ee61b (diff) |
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.cpp | 8 |
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); |