Skip to content

Commit e33ce80

Browse files
authored
use saturating_sub isntead of wrapping_sub
1 parent 1c60ed1 commit e33ce80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/consensus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub fn relative_min_window_density(b1: &MinaConsensusState, b2: &MinaConsensusSt
7676
let projected_window = {
7777
// Compute shift count
7878
let shift_count =
79-
(max_slot.wrapping_sub(global_slot(b1) + 1)).clamp(0, SUB_WINDOWS_PER_WINDOW);
79+
(max_slot.saturating_sub(global_slot(b1) + 1)).clamp(0, SUB_WINDOWS_PER_WINDOW);
8080

8181
// Initialize projected window
8282
let mut projected_window = b1

0 commit comments

Comments
 (0)