diff options
Diffstat (limited to 'src/validationinterface.h')
-rw-r--r-- | src/validationinterface.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/validationinterface.h b/src/validationinterface.h index 00efc085b3..bddc28d24a 100644 --- a/src/validationinterface.h +++ b/src/validationinterface.h @@ -76,7 +76,11 @@ protected: */ ~CValidationInterface() = default; /** - * Notifies listeners of updated block chain tip + * 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. */ @@ -114,15 +118,20 @@ protected: /** * Notifies listeners of the new active block chain on-disk. * - * Called on a background thread. - */ - virtual void SetBestChain(const CBlockLocator &locator) {} - /** - * Notifies listeners about an inventory item being seen on the network. + * 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. */ - virtual void Inventory(const uint256 &hash) {} + virtual void ChainStateFlushed(const CBlockLocator &locator) {} /** Tells listeners to broadcast their data. */ virtual void ResendWalletTransactions(int64_t nBestBlockTime, CConnman* connman) {} /** @@ -172,8 +181,7 @@ public: void TransactionAddedToMempool(const CTransactionRef &); void BlockConnected(const std::shared_ptr<const CBlock> &, const CBlockIndex *pindex, const std::shared_ptr<const std::vector<CTransactionRef>> &); void BlockDisconnected(const std::shared_ptr<const CBlock> &); - void SetBestChain(const CBlockLocator &); - void Inventory(const uint256 &); + void ChainStateFlushed(const CBlockLocator &); void Broadcast(int64_t nBestBlockTime, CConnman* connman); void BlockChecked(const CBlock&, const CValidationState&); void NewPoWValidBlock(const CBlockIndex *, const std::shared_ptr<const CBlock>&); |