@@ -98,28 +98,20 @@ where
9898 "Checking segment header"
9999 ) ;
100100
101- let last_full_archived_block_number = if last_archived_block_partial {
102- // The genesis block is always fully reconstructed, so we can saturating_sub here
103- NumberFor :: < Block > :: from ( last_archived_maybe_partial_block_number)
104- . saturating_sub ( 1u32 . into ( ) )
105- } else {
106- NumberFor :: < Block > :: from ( last_archived_maybe_partial_block_number)
107- } ;
108-
109101 let info = client. info ( ) ;
110- // We have already processed the last block that's completely in this segment, or one
111- // higher than it, so it can't change. Resetting the reconstructor loses any partial
112- // blocks, so we only reset based on fully reconstructed blocks.
113- if * last_processed_block_number >= last_full_archived_block_number {
102+ let last_archived_maybe_partial_block_number =
103+ NumberFor :: < Block > :: from ( last_archived_maybe_partial_block_number) ;
104+ // We have already processed the last block in this segment, or one higher than it,
105+ // so it can't change. Resetting the reconstructor loses any partial blocks, so we
106+ // only reset if the (possibly partial) last block has been processed.
107+ if * last_processed_block_number >= last_archived_maybe_partial_block_number {
114108 * last_processed_segment_index = segment_index;
115109 // Reset reconstructor instance
116110 reconstructor = Arc :: new ( Mutex :: new ( Reconstructor :: new ( erasure_coding. clone ( ) ) ) ) ;
117111 continue ;
118112 }
119113 // Just one partial unprocessed block and this was the last segment available, so nothing to
120114 // import
121- let last_archived_maybe_partial_block_number =
122- NumberFor :: < Block > :: from ( last_archived_maybe_partial_block_number) ;
123115 if last_archived_maybe_partial_block_number == * last_processed_block_number + One :: one ( )
124116 && last_archived_block_partial
125117 && segment_indices_iter. peek ( ) . is_none ( )
0 commit comments