mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(prune): saturating subtract for genesis deposit contract block (#9584)
This commit is contained in:
@ -40,7 +40,9 @@ impl PruneMode {
|
||||
}
|
||||
Self::Before(n) if *n == tip + 1 && purpose.is_static_file() => Some((tip, *self)),
|
||||
Self::Before(n) if *n > tip => None, // Nothing to prune yet
|
||||
Self::Before(n) if tip - n >= segment.min_blocks(purpose) => Some((n - 1, *self)),
|
||||
Self::Before(n) if tip - n >= segment.min_blocks(purpose) => {
|
||||
Some(((*n).saturating_sub(1), *self))
|
||||
}
|
||||
_ => return Err(PruneSegmentError::Configuration(segment)),
|
||||
};
|
||||
Ok(result)
|
||||
|
||||
Reference in New Issue
Block a user