Fire TransactionRemovedFromMempool from mempool

This commit fires TransactionRemovedFromMempool callbacks from the
mempool and cleans up a bunch of code.
This commit is contained in:
251
2019-07-23 23:47:17 +02:00
parent 69a6f1ad1f
commit e20c72f9f0
5 changed files with 15 additions and 36 deletions

View File

@@ -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);