mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore: apply some style suggestions (#7307)
This commit is contained in:
@ -91,13 +91,14 @@ impl<DB: Database> Pruner<DB> {
|
||||
// `self.prune_max_blocks_per_run`.
|
||||
//
|
||||
// Also see docs for `self.previous_tip_block_number`.
|
||||
let blocks_since_last_run =
|
||||
(self.previous_tip_block_number.map_or(1, |previous_tip_block_number| {
|
||||
let blocks_since_last_run = self
|
||||
.previous_tip_block_number
|
||||
.map_or(1, |previous_tip_block_number| {
|
||||
// Saturating subtraction is needed for the case when the chain was reverted,
|
||||
// meaning current block number might be less than the previous tip
|
||||
// block number.
|
||||
tip_block_number.saturating_sub(previous_tip_block_number) as usize
|
||||
}))
|
||||
})
|
||||
.min(self.prune_max_blocks_per_run);
|
||||
let delete_limit = self.delete_limit * blocks_since_last_run;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ impl<DB: Database> Segment<DB> for TransactionLookup {
|
||||
}
|
||||
}
|
||||
.into_inner();
|
||||
let tx_range = start..=(end.min(start + input.delete_limit as u64 - 1));
|
||||
let tx_range = start..=end.min(start + input.delete_limit as u64 - 1);
|
||||
let tx_range_end = *tx_range.end();
|
||||
|
||||
// Retrieve transactions in the range and calculate their hashes in parallel
|
||||
|
||||
Reference in New Issue
Block a user