Changeset View
Changeset View
Standalone View
Standalone View
src/validationinterface.h
Show First 20 Lines • Show All 98 Lines • ▼ Show 20 Lines | protected: | ||||
* in BlockConnectedDisconnected either in block->vtx or in txnConflicted. | * in BlockConnectedDisconnected either in block->vtx or in txnConflicted. | ||||
* | * | ||||
* Called on a background thread. | * Called on a background thread. | ||||
*/ | */ | ||||
virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx) {} | virtual void TransactionRemovedFromMempool(const CTransactionRef &ptx) {} | ||||
/** | /** | ||||
* Notifies listeners of a block being connected. | * Notifies listeners of a block being connected. | ||||
* Provides a vector of transactions evicted from the mempool as a result. | * Provides a vector of transactions evicted from the mempool as a result. | ||||
* | |||||
* Called on a background thread. | |||||
*/ | */ | ||||
virtual void | virtual void | ||||
BlockConnected(const std::shared_ptr<const CBlock> &block, | BlockConnected(const std::shared_ptr<const CBlock> &block, | ||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &txnConflicted) {} | const std::vector<CTransactionRef> &txnConflicted) {} | ||||
/** Notifies listeners of a block being disconnected */ | /** | ||||
* Notifies listeners of a block being disconnected | |||||
* | |||||
* Called on a background thread. | |||||
*/ | |||||
virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block) { | virtual void BlockDisconnected(const std::shared_ptr<const CBlock> &block) { | ||||
} | } | ||||
/** | /** | ||||
* Notifies listeners of the new active block chain on-disk. | * Notifies listeners of the new active block chain on-disk. | ||||
* | * | ||||
* Prior to this callback, any updates are not guaranteed to persist 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 | * (ie clients need to handle shutdown/restart safety by being able to | ||||
* understand when some updates were lost due to unclean shutdown). | * understand when some updates were lost due to unclean shutdown). | ||||
* | * | ||||
* When this callback is invoked, the validation changes done by any prior | * When this callback is invoked, the validation changes done by any prior | ||||
* callback are guaranteed to exist on disk and survive a restart, including | * callback are guaranteed to exist on disk and survive a restart, including | ||||
* an unclean shutdown. | * an unclean shutdown. | ||||
* | * | ||||
* Provides a locator describing the best chain, which is likely useful for | * Provides a locator describing the best chain, which is likely useful for | ||||
* storing current state on disk in client DBs. | * storing current state on disk in client DBs. | ||||
* | * | ||||
* Called on a background thread. | * Called on a background thread. | ||||
*/ | */ | ||||
virtual void ChainStateFlushed(const CBlockLocator &locator) {} | virtual void ChainStateFlushed(const CBlockLocator &locator) {} | ||||
/** Notifies listeners about an inventory item being seen on the network. */ | /** | ||||
* Notifies listeners about an inventory item being seen on the network. | |||||
* | |||||
* Called on a background thread. | |||||
*/ | |||||
virtual void Inventory(const uint256 &hash) {} | virtual void Inventory(const uint256 &hash) {} | ||||
/** Tells listeners to broadcast their data. */ | /** Tells listeners to broadcast their data. */ | ||||
virtual void ResendWalletTransactions(int64_t nBestBlockTime, | virtual void ResendWalletTransactions(int64_t nBestBlockTime, | ||||
CConnman *connman) {} | CConnman *connman) {} | ||||
/** | /** | ||||
* Notifies listeners of a block validation result. | * Notifies listeners of a block validation result. | ||||
* If the provided CValidationState IsValid, the provided block | * If the provided CValidationState IsValid, the provided block | ||||
* is guaranteed to be the current best block at the time the | * is guaranteed to be the current best block at the time the | ||||
▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | public: | ||||
/** Register with mempool to call TransactionRemovedFromMempool callbacks */ | /** Register with mempool to call TransactionRemovedFromMempool callbacks */ | ||||
void RegisterWithMempoolSignals(CTxMemPool &pool); | void RegisterWithMempoolSignals(CTxMemPool &pool); | ||||
/** Unregister with mempool */ | /** Unregister with mempool */ | ||||
void UnregisterWithMempoolSignals(CTxMemPool &pool); | void UnregisterWithMempoolSignals(CTxMemPool &pool); | ||||
void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, | void UpdatedBlockTip(const CBlockIndex *, const CBlockIndex *, | ||||
bool fInitialDownload); | bool fInitialDownload); | ||||
void TransactionAddedToMempool(const CTransactionRef &); | void TransactionAddedToMempool(const CTransactionRef &); | ||||
void BlockConnected(const std::shared_ptr<const CBlock> &, | void | ||||
BlockConnected(const std::shared_ptr<const CBlock> &, | |||||
const CBlockIndex *pindex, | const CBlockIndex *pindex, | ||||
const std::vector<CTransactionRef> &); | const std::shared_ptr<const std::vector<CTransactionRef>> &); | ||||
void BlockDisconnected(const std::shared_ptr<const CBlock> &); | void BlockDisconnected(const std::shared_ptr<const CBlock> &); | ||||
void ChainStateFlushed(const CBlockLocator &); | void ChainStateFlushed(const CBlockLocator &); | ||||
void Inventory(const uint256 &); | void Inventory(const uint256 &); | ||||
void Broadcast(int64_t nBestBlockTime, CConnman *connman); | void Broadcast(int64_t nBestBlockTime, CConnman *connman); | ||||
void BlockChecked(const CBlock &, const CValidationState &); | void BlockChecked(const CBlock &, const CValidationState &); | ||||
void NewPoWValidBlock(const CBlockIndex *, | void NewPoWValidBlock(const CBlockIndex *, | ||||
const std::shared_ptr<const CBlock> &); | const std::shared_ptr<const CBlock> &); | ||||
}; | }; | ||||
CMainSignals &GetMainSignals(); | CMainSignals &GetMainSignals(); | ||||
#endif // BITCOIN_VALIDATIONINTERFACE_H | #endif // BITCOIN_VALIDATIONINTERFACE_H |