[#CValidationInterface]
= CValidationInterface
:mrdocs:

Implement this to subscribe to events generated in validation and mempool

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class CValidationInterface;
----

== Description

Each CValidationInterface() subscriber will receive event callbacks in the order in which the events were generated by validation and mempool&period; Furthermore, each ValidationInterface() subscriber may assume that callbacks effectively run in a single thread with single&hyphen;threaded memory consistency&period; That is, for a given ValidationInterface() instantiation, each callback will complete before the next one is invoked&period; This means, for example when a block is connected that the UpdatedBlockTip() callback may depend on an operation performed in the BlockConnected() callback without worrying about explicit synchronization&period; No ordering should be assumed across ValidationInterface() subscribers&period;

== Protected Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CValidationInterface/2destructor.adoc[`&#126;CValidationInterface`] [.small]#[destructor]#
| Protected destructor so that instances can only be deleted by derived classes&period; If that restriction is no longer desired, this should be made public and virtual&period;
| xref:CValidationInterface/ActiveTipChange.adoc[`ActiveTipChange`]  [.small]#[virtual]#
| Notifies listeners any time the block chain tip changes, synchronously&period;
| xref:CValidationInterface/BlockChecked.adoc[`BlockChecked`]  [.small]#[virtual]#
| Notifies listeners of a block validation result&period; If the provided BlockValidationState IsValid, the provided block is guaranteed to be the current best block at the time the callback was generated (not necessarily now)&period;
| xref:CValidationInterface/BlockConnected.adoc[`BlockConnected`]  [.small]#[virtual]#
| Notifies listeners of a block being connected&period;
| xref:CValidationInterface/BlockDisconnected.adoc[`BlockDisconnected`]  [.small]#[virtual]#
| Notifies listeners of a block being disconnected Provides the block that was disconnected&period;
| xref:CValidationInterface/ChainStateFlushed.adoc[`ChainStateFlushed`]  [.small]#[virtual]#
| Notifies listeners of the new active block chain on&hyphen;disk&period;
| xref:CValidationInterface/MempoolTransactionsRemovedForBlock.adoc[`MempoolTransactionsRemovedForBlock`]  [.small]#[virtual]#
| Notifies listeners of transactions removed from the mempool as as a result of new block being connected&period; MempoolTransactionsRemovedForBlock will be fired before BlockConnected&period;
| xref:CValidationInterface/NewPoWValidBlock.adoc[`NewPoWValidBlock`]  [.small]#[virtual]#
| Notifies listeners that a block which builds directly on our current tip has been received and connected to the headers tree, though not validated yet&period;
| xref:CValidationInterface/TransactionAddedToMempool.adoc[`TransactionAddedToMempool`]  [.small]#[virtual]#
| Notifies listeners of a transaction having been added to mempool&period;
| xref:CValidationInterface/TransactionRemovedFromMempool.adoc[`TransactionRemovedFromMempool`]  [.small]#[virtual]#
| Notifies listeners of a transaction leaving mempool&period;
| xref:CValidationInterface/UpdatedBlockTip.adoc[`UpdatedBlockTip`]  [.small]#[virtual]#
| Notifies listeners when the block chain tip advances&period;
|===


== Friends

[cols="1,4"]
|===
| Name| Description
| `xref:ValidationInterfaceTest.adoc[ValidationInterfaceTest]`
| Test fixture granted access to the interface&apos;s protected callbacks&period;
| `xref:ValidationSignals.adoc[ValidationSignals]`
| Dispatches validation event notifications to registered subscribers&period;
|===

== Derived Classes

[cols="1,4"]
|===
| Name| Description
| xref:BaseIndex.adoc[`BaseIndex`] 
| Base class for the node&apos;s optional block&hyphen;chain indexes&period;
| xref:CZMQNotificationInterface.adoc[`CZMQNotificationInterface`] 
| Validation&hyphen;interface listener that fans node events out to the configured ZMQ notifiers&period;
| xref:FeeRateEstimatorManager.adoc[`FeeRateEstimatorManager`] 
| Tracks fee&hyphen;rate estimates derived from observed transactions&period;
| xref:PeerManager.adoc[`PeerManager`] 
| Drives the peer&hyphen;to&hyphen;peer message processing and relay logic for a node&period;
|===


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