[#CValidationInterface] = CValidationInterface :mrdocs: Implement this to subscribe to events generated in validation and mempool == Synopsis Declared in `<validationinterface.h>` [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. Furthermore, each ValidationInterface() subscriber may assume that callbacks effectively run in a single thread with single‐threaded memory consistency. That is, for a given ValidationInterface() instantiation, each callback will complete before the next one is invoked. 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. No ordering should be assumed across ValidationInterface() subscribers. == Protected Member Functions [cols="1,4"] |=== | Name| Description | xref:CValidationInterface/2destructor.adoc[`~CValidationInterface`] [.small]#[destructor]# | Protected destructor so that instances can only be deleted by derived classes. If that restriction is no longer desired, this should be made public and virtual. | xref:CValidationInterface/ActiveTipChange.adoc[`ActiveTipChange`] [.small]#[virtual]# | Notifies listeners any time the block chain tip changes, synchronously. | xref:CValidationInterface/BlockChecked.adoc[`BlockChecked`] [.small]#[virtual]# | Notifies listeners of a block validation result. 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). | xref:CValidationInterface/BlockConnected.adoc[`BlockConnected`] [.small]#[virtual]# | Notifies listeners of a block being connected. | xref:CValidationInterface/BlockDisconnected.adoc[`BlockDisconnected`] [.small]#[virtual]# | Notifies listeners of a block being disconnected Provides the block that was disconnected. | xref:CValidationInterface/ChainStateFlushed.adoc[`ChainStateFlushed`] [.small]#[virtual]# | Notifies listeners of the new active block chain on‐disk. | xref:CValidationInterface/MempoolTransactionsRemovedForBlock.adoc[`MempoolTransactionsRemovedForBlock`] [.small]#[virtual]# | Notifies listeners of transactions removed from the mempool as as a result of new block being connected. MempoolTransactionsRemovedForBlock will be fired before BlockConnected. | 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. | xref:CValidationInterface/TransactionAddedToMempool.adoc[`TransactionAddedToMempool`] [.small]#[virtual]# | Notifies listeners of a transaction having been added to mempool. | xref:CValidationInterface/TransactionRemovedFromMempool.adoc[`TransactionRemovedFromMempool`] [.small]#[virtual]# | Notifies listeners of a transaction leaving mempool. | xref:CValidationInterface/UpdatedBlockTip.adoc[`UpdatedBlockTip`] [.small]#[virtual]# | Notifies listeners when the block chain tip advances. |=== == Friends [cols="1,4"] |=== | Name| Description | `xref:ValidationInterfaceTest.adoc[ValidationInterfaceTest]` | Test fixture granted access to the interface's protected callbacks. | `xref:ValidationSignals.adoc[ValidationSignals]` | Dispatches validation event notifications to registered subscribers. |=== == Derived Classes [cols="1,4"] |=== | Name| Description | xref:BaseIndex.adoc[`BaseIndex`] | Base class for the node's optional block‐chain indexes. | xref:CZMQNotificationInterface.adoc[`CZMQNotificationInterface`] | Validation‐interface listener that fans node events out to the configured ZMQ notifiers. | xref:FeeRateEstimatorManager.adoc[`FeeRateEstimatorManager`] | Tracks fee‐rate estimates derived from observed transactions. | xref:PeerManager.adoc[`PeerManager`] | Drives the peer‐to‐peer message processing and relay logic for a node. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#