Skip to content

Commit

Permalink
Underflow panic doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex6323 committed Apr 29, 2022
1 parent fb98cbd commit 1afb083
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions bee-ledger/src/workers/pruning/condition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ pub(crate) fn should_prune<S: StorageBackend>(
if *ledger_index < target_index_threshold {
Err(PruningSkipReason::BelowTargetIndexThreshold)
} else {
// Panic: cannot underflow due to ledger_size >= target_index_threshold = pruning_index +
// milestones_to_keep.
let target_pruning_index = *ledger_index - milestones_to_keep;

Ok(PruningTask::ByIndexRange {
Expand Down

0 comments on commit 1afb083

Please sign in to comment.