Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 1afb083

Browse files
committed
Underflow panic doc
1 parent fb98cbd commit 1afb083

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bee-ledger/src/workers/pruning/condition.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ pub(crate) fn should_prune<S: StorageBackend>(
112112
if *ledger_index < target_index_threshold {
113113
Err(PruningSkipReason::BelowTargetIndexThreshold)
114114
} else {
115+
// Panic: cannot underflow due to ledger_size >= target_index_threshold = pruning_index +
116+
// milestones_to_keep.
115117
let target_pruning_index = *ledger_index - milestones_to_keep;
116118

117119
Ok(PruningTask::ByIndexRange {

0 commit comments

Comments
 (0)