mirror of
https://github.com/paradigmxyz/reth.git
synced 2026-02-19 03:04:27 -05:00
fix(prune): avoid panic in tx lookup (#21275)
This commit is contained in:
@@ -84,7 +84,14 @@ where
|
||||
.into_inner();
|
||||
let tx_range = start..=
|
||||
Some(end)
|
||||
.min(input.limiter.deleted_entries_limit_left().map(|left| start + left as u64 - 1))
|
||||
.min(
|
||||
input
|
||||
.limiter
|
||||
.deleted_entries_limit_left()
|
||||
// Use saturating addition here to avoid panicking on
|
||||
// `deleted_entries_limit == usize::MAX`
|
||||
.map(|left| start.saturating_add(left as u64) - 1),
|
||||
)
|
||||
.unwrap();
|
||||
let tx_range_end = *tx_range.end();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user