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

Commit cbe1292

Browse files
committed
Underflow panic doc
1 parent fb98cbd commit cbe1292

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ 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 + milestones_to_keep.
115116
let target_pruning_index = *ledger_index - milestones_to_keep;
116117

117118
Ok(PruningTask::ByIndexRange {

0 commit comments

Comments
 (0)