[#CValidationInterface-TransactionRemovedFromMempool]
= xref:CValidationInterface.adoc[CValidationInterface]::TransactionRemovedFromMempool
:relfileprefix: ../
:mrdocs:

Notifies listeners of a transaction leaving mempool&period;

== Synopsis

Declared in `&lt;validationinterface&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
void
TransactionRemovedFromMempool(
    xref:CTransactionRef.adoc[CTransactionRef] const& tx,
    xref:MemPoolRemovalReason.adoc[MemPoolRemovalReason] reason,
    uint64&lowbar;t mempool&lowbar;sequence);
----

== Description

This notification fires for transactions that are removed from the mempool for the following reasons&colon;

* EXPIRY (expired from mempool after &hyphen;mempoolexpiry hours)
* SIZELIMIT (removed in size limiting if the mempool exceeds &hyphen;maxmempool megabytes)
* REORG (removed during a reorg)
* CONFLICT (removed because it conflicts with in&hyphen;block transaction)
* REPLACED (removed due to RBF replacement)

This does not fire for transactions that are removed from the mempool because they have been included in a block&period; Any client that is interested in transactions removed from the mempool for inclusion in a block can learn about those transactions from the MempoolTransactionsRemovedForBlock notification&period;

Transactions that are removed from the mempool because they conflict with a transaction in the new block will have TransactionRemovedFromMempool events fired _before_ the BlockConnected event is fired&period; If multiple blocks are connected in one step, then the ordering could be&colon;

* TransactionRemovedFromMempool(tx1 from block A)
* TransactionRemovedFromMempool(tx2 from block A)
* TransactionRemovedFromMempool(tx1 from block B)
* TransactionRemovedFromMempool(tx2 from block B)
* BlockConnected(A)
* BlockConnected(B)

Called on a background thread&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *tx*
| The transaction removed from the mempool&period;
| *reason*
| Why the transaction was removed&period;
| *mempool&lowbar;sequence*
| Mempool sequence number at the time of the removal&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
