File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -136,10 +136,12 @@ async fn initialize_live_streaming_state<N: Network>(
136136
137137 let confirmed = incoming_block_num. saturating_sub ( block_confirmations) ;
138138
139+ // The minimum common ancestor is the block before the stream start
140+ let min_common_ancestor = stream_start. saturating_sub ( 1 ) ;
141+
139142 // Catch up on any confirmed blocks between stream_start and the confirmed tip
140- // todo: explain why stream_start - 1 is min_common_ancestor
141143 let previous_batch_end = stream_range_with_reorg_handling (
142- stream_start . saturating_sub ( 1 ) ,
144+ min_common_ancestor ,
143145 stream_start,
144146 confirmed,
145147 max_block_range,
@@ -291,8 +293,11 @@ async fn stream_next_batch<N: Network>(
291293 return true ;
292294 }
293295
296+ // The minimum common ancestor is the block before the stream start
297+ let min_common_ancestor = stream_start. saturating_sub ( 1 ) ;
298+
294299 state. previous_batch_end = stream_range_with_reorg_handling (
295- stream_start . saturating_sub ( 1 ) ,
300+ min_common_ancestor ,
296301 state. batch_start ,
297302 batch_end_num,
298303 max_block_range,
You can’t perform that action at this time.
0 commit comments