Skip to content

Commit

Permalink
saturating sub
Browse files Browse the repository at this point in the history
  • Loading branch information
jayantk committed Dec 4, 2023
1 parent 57c6328 commit f206d3b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fortuna/src/api/revelation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ pub async fn revelation(
.map_err(|_| RestError::TemporarilyUnavailable)?;

match maybe_request {
Some(r) if current_block_number - state.confirmation_blocks >= r.block_number => {
Some(r)
if current_block_number.saturating_sub(state.confirmation_blocks) >= r.block_number =>
{
let value = &state
.state
.reveal(sequence)
Expand Down

0 comments on commit f206d3b

Please sign in to comment.