diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index a2d78efd7b..818a487f69 100644 --- a/crates/esplora/src/async_ext.rs +++ b/crates/esplora/src/async_ext.rs @@ -261,7 +261,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient { } } - if last_index > last_active_index.map(|i| i + stop_gap as u32) { + if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) { break; } } diff --git a/crates/esplora/src/blocking_ext.rs b/crates/esplora/src/blocking_ext.rs index 6d42fe015a..adc1883243 100644 --- a/crates/esplora/src/blocking_ext.rs +++ b/crates/esplora/src/blocking_ext.rs @@ -252,7 +252,7 @@ impl EsploraExt for esplora_client::BlockingClient { } } - if last_index > last_active_index.map(|i| i + stop_gap as u32) { + if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) { break; } }