File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -244,7 +244,9 @@ impl<DB: Database> Pruner<DB> {
244
244
/// Returns `true` if the pruning is needed at the provided tip block number.
245
245
/// This determined by the check against minimum pruning interval and last pruned block number.
246
246
pub fn is_pruning_needed ( & self , tip_block_number : BlockNumber ) -> bool {
247
- if self . previous_tip_block_number . map_or ( true , |previous_tip_block_number| {
247
+ if tip_block_number < self . min_block_interval as u64 {
248
+ false
249
+ } else if self . previous_tip_block_number . map_or ( true , |previous_tip_block_number| {
248
250
// Saturating subtraction is needed for the case when the chain was reverted, meaning
249
251
// current block number might be less than the previous tip block number.
250
252
// If that's the case, no pruning is needed as outdated data is also reverted.
You can’t perform that action at this time.
0 commit comments