Bitcoin ABC 0.26.3
P2P Digital Currency
|
Implement this to subscribe to events generated in validation. More...
#include <validationinterface.h>
Protected Member Functions | |
~CValidationInterface ()=default | |
Protected destructor so that instances can only be deleted by derived classes. | |
virtual void | UpdatedBlockTip (const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) |
Notifies listeners when the block chain tip advances. | |
virtual void | TransactionAddedToMempool (const CTransactionRef &tx, std::shared_ptr< const std::vector< Coin > > spent_coins, uint64_t mempool_sequence) |
Notifies listeners of a transaction having been added to mempool. | |
virtual void | TransactionRemovedFromMempool (const CTransactionRef &tx, MemPoolRemovalReason reason, uint64_t mempool_sequence) |
Notifies listeners of a transaction leaving mempool. | |
virtual void | BlockConnected (const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex) |
Notifies listeners of a block being connected. | |
virtual void | BlockDisconnected (const std::shared_ptr< const CBlock > &block, const CBlockIndex *pindex) |
Notifies listeners of a block being disconnected. | |
virtual void | ChainStateFlushed (const CBlockLocator &locator) |
Notifies listeners of the new active block chain on-disk. | |
virtual void | BlockChecked (const CBlock &, const BlockValidationState &) |
Notifies listeners of a block validation result. | |
virtual void | NewPoWValidBlock (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &block) |
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. | |
virtual void | BlockFinalized (const CBlockIndex *pindex) |
virtual void | BlockInvalidated (const CBlockIndex *pindex, const std::shared_ptr< const CBlock > &block) |
Friends | |
class | CMainSignals |
class | ValidationInterfaceTest |
Implement this to subscribe to events generated in validation.
Each CValidationInterface() subscriber will receive event callbacks in the order in which the events were generated by validation. 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.
Definition at line 82 of file validationinterface.h.
|
protecteddefault |
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.
|
inlineprotectedvirtual |
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)
Reimplemented in submitblock_StateCatcher.
Definition at line 185 of file validationinterface.h.
|
inlineprotectedvirtual |
Notifies listeners of a block being connected.
Provides a vector of transactions evicted from the mempool as a result.
Called on a background thread.
Reimplemented in BaseIndex, and CZMQNotificationInterface.
Definition at line 153 of file validationinterface.h.
|
inlineprotectedvirtual |
Notifies listeners of a block being disconnected.
Called on a background thread.
Reimplemented in CZMQNotificationInterface.
Definition at line 160 of file validationinterface.h.
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
|
inlineprotectedvirtual |
Notifies listeners of the new active block chain on-disk.
Prior to this callback, any updates are not guaranteed to persist on disk (ie clients need to handle shutdown/restart safety by being able to understand when some updates were lost due to unclean shutdown).
When this callback is invoked, the validation changes done by any prior callback are guaranteed to exist on disk and survive a restart, including an unclean shutdown.
Provides a locator describing the best chain, which is likely useful for storing current state on disk in client DBs.
Called on a background thread.
Reimplemented in BaseIndex.
Definition at line 178 of file validationinterface.h.
|
inlineprotectedvirtual |
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.
Definition at line 191 of file validationinterface.h.
|
inlineprotectedvirtual |
Notifies listeners of a transaction having been added to mempool.
Called on a background thread.
Reimplemented in CZMQNotificationInterface.
Definition at line 107 of file validationinterface.h.
|
inlineprotectedvirtual |
Notifies listeners of a transaction leaving mempool.
This notification fires for transactions that are removed from the mempool for the following reasons:
This does not fire for transactions that are removed from the mempool because they have been included in a block. Any client that is interested in transactions removed from the mempool for inclusion in a block can learn about those transactions from the BlockConnected notification.
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. If multiple blocks are connected in one step, then the ordering could be:
Called on a background thread.
Reimplemented in CZMQNotificationInterface.
Definition at line 144 of file validationinterface.h.
|
inlineprotectedvirtual |
Notifies listeners when the block chain tip advances.
When multiple blocks are connected at once, UpdatedBlockTip will be called on the final tip but may not be called on every intermediate tip. If the latter behavior is desired, subscribe to BlockConnected() instead.
Called on a background thread.
Reimplemented in CZMQNotificationInterface.
Definition at line 99 of file validationinterface.h.
|
friend |
Definition at line 198 of file validationinterface.h.
Definition at line 199 of file validationinterface.h.