Skip to content

Commit eaedc0a

Browse files
committed
Clean up MicroSPVClient documentation
1 parent 87a9b99 commit eaedc0a

File tree

1 file changed

+7
-4
lines changed
  • lightning-block-sync/src

1 file changed

+7
-4
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -410,8 +410,8 @@ pub async fn init_sync_listener<CL: ChainListener, B: BlockSource>(new_block: Bl
410410
/// Unbounded cache of header data keyed by block hash.
411411
pub(crate) type HeaderCache = std::collections::HashMap<BlockHash, ValidatedBlockHeader>;
412412

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.
415415
///
416416
/// This implements a pretty bare-bones SPV client, checking all relevant commitments and finding
417417
/// 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> {
453453
Self { chain_tip, chain_poller, chain_notifier, chain_listener }
454454
}
455455

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.
458461
pub async fn poll_best_tip(&mut self) -> BlockSourceResult<(ChainTip, bool)> {
459462
let chain_tip = self.chain_poller.poll_chain_tip(self.chain_tip).await?;
460463
let blocks_connected = match chain_tip {

0 commit comments

Comments
 (0)