Skip to content

Commit cc69ee7

Browse files
committed
f - Rephrase BlockSource documentation
1 parent 690b432 commit cc69ee7

File tree

1 file changed

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

1 file changed

+7
-7
lines changed

lightning-block-sync/src/lib.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,21 @@ use std::pin::Pin;
1414

1515
/// Abstract type for retrieving block headers and data.
1616
pub trait BlockSource : Sync + Send {
17-
/// Returns the header for a given hash. A height hint may be provided in case a source cannot
18-
/// easily find headers based on a hash. This is merely a hint and thus the returned header must
19-
/// have the same hash as was requested. Otherwise, an error must be returned.
17+
/// Returns the header for a given hash. A height hint may be provided in case a block source
18+
/// cannot easily find headers based on a hash. This is merely a hint and thus the returned
19+
/// header must have the same hash as was requested. Otherwise, an error must be returned.
2020
///
2121
/// Implementations that cannot find headers based on the hash should return a `Transient` error
22-
/// when `height_hint` is `None`. In such a case, `get_best_block` should never return `None`
23-
/// for the height. Otherwise, the source could not be used independently for an initial sync.
22+
/// when `height_hint` is `None`.
2423
fn get_header<'a>(&'a mut self, header_hash: &'a BlockHash, height_hint: Option<u32>) -> AsyncBlockSourceResult<'a, BlockHeaderData>;
2524

2625
/// Returns the block for a given hash. A headers-only block source should return a `Transient`
2726
/// error.
2827
fn get_block<'a>(&'a mut self, header_hash: &'a BlockHash) -> AsyncBlockSourceResult<'a, Block>;
2928

30-
/// Returns the hash of the best block and, optionally, its height. The height is passed to
31-
/// `get_header` to allow a more efficient lookup on some block sources.
29+
// TODO: Phrase in terms of `Poll` once added.
30+
/// Returns the hash of the best block and, optionally, its height. When polling a block source,
31+
/// the height is passed to `get_header` to allow for a more efficient lookup.
3232
fn get_best_block<'a>(&'a mut self) -> AsyncBlockSourceResult<(BlockHash, Option<u32>)>;
3333
}
3434

0 commit comments

Comments
 (0)