@@ -98,28 +98,20 @@ where
98
98
"Checking segment header"
99
99
) ;
100
100
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
-
109
101
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 {
114
108
* last_processed_segment_index = segment_index;
115
109
// Reset reconstructor instance
116
110
reconstructor = Arc :: new ( Mutex :: new ( Reconstructor :: new ( erasure_coding. clone ( ) ) ) ) ;
117
111
continue ;
118
112
}
119
113
// Just one partial unprocessed block and this was the last segment available, so nothing to
120
114
// import
121
- let last_archived_maybe_partial_block_number =
122
- NumberFor :: < Block > :: from ( last_archived_maybe_partial_block_number) ;
123
115
if last_archived_maybe_partial_block_number == * last_processed_block_number + One :: one ( )
124
116
&& last_archived_block_partial
125
117
&& segment_indices_iter. peek ( ) . is_none ( )
0 commit comments