diff --git a/crates/esplora/src/async_ext.rs b/crates/esplora/src/async_ext.rs index 98c47253f..279c8e962 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 5220cf07f..17c364ca9 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; } }