Skip to content

Commit 46ff151

Browse files
committed
doc: stream_historical_blocks: add comment about one of assumptions
1 parent 6eb3941 commit 46ff151

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/block_range_scanner.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ impl<N: Network> Service<N> {
614614
info!(batch_count = batch_count, "Rewind completed");
615615
}
616616

617+
/// Assumes that `stream_start <= next_start_block <= end`.
617618
async fn stream_historical_blocks(
618619
stream_start: BlockNumber,
619620
mut next_start_block: BlockNumber,
@@ -625,8 +626,6 @@ impl<N: Network> Service<N> {
625626
) -> Option<N::BlockResponse> {
626627
let mut batch_count = 0;
627628

628-
// must be <= to include the edge case when start == end (i.e. return the single block
629-
// range)
630629
loop {
631630
let batch_end_num = next_start_block.saturating_add(max_block_range - 1).min(end);
632631
let batch_end = match provider.get_block_by_number(batch_end_num.into()).await {

0 commit comments

Comments
 (0)