@@ -410,8 +410,8 @@ pub async fn init_sync_listener<CL: ChainListener, B: BlockSource>(new_block: Bl
410
410
/// Unbounded cache of header data keyed by block hash.
411
411
pub ( crate ) type HeaderCache = std:: collections:: HashMap < BlockHash , ValidatedBlockHeader > ;
412
412
413
- /// Keep the chain that a chain listener knows about up-to-date with the best chain from any of the
414
- /// given block_sources .
413
+ /// A lightweight client for keeping a listener in sync with the chain, which is polled using one
414
+ /// one or more block sources .
415
415
///
416
416
/// This implements a pretty bare-bones SPV client, checking all relevant commitments and finding
417
417
/// the heaviest chain, but not storing the full header chain, leading to some important
@@ -453,8 +453,11 @@ impl<P: Poll, CL: ChainListener> MicroSPVClient<P, CL> {
453
453
Self { chain_tip, chain_poller, chain_notifier, chain_listener }
454
454
}
455
455
456
- /// Check each source for a new best tip and update the chain listener accordingly.
457
- /// Returns true if some blocks were [dis]connected, false otherwise.
456
+ /// Polls for the best tip and updates the chain listener with any connected or disconnected
457
+ /// blocks accordingly.
458
+ ///
459
+ /// Returns the best polled chain tip relative to the previous best known tip and whether any
460
+ /// blocks were indeed connected or disconnected.
458
461
pub async fn poll_best_tip ( & mut self ) -> BlockSourceResult < ( ChainTip , bool ) > {
459
462
let chain_tip = self . chain_poller . poll_chain_tip ( self . chain_tip ) . await ?;
460
463
let blocks_connected = match chain_tip {
0 commit comments