Skip to content

Commit 6a5c9d7

Browse files
committed
fix(esplora): use saturating_add in update_tx_graph()
This fixes overflow error when calling update_tx_graph() from update_tx_graph_without_keychain().
1 parent 4d1a9fd commit 6a5c9d7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/esplora/src/async_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
261261
}
262262
}
263263

264-
if last_index > last_active_index.map(|i| i + stop_gap as u32) {
264+
if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) {
265265
break;
266266
}
267267
}

crates/esplora/src/blocking_ext.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ impl EsploraExt for esplora_client::BlockingClient {
252252
}
253253
}
254254

255-
if last_index > last_active_index.map(|i| i + stop_gap as u32) {
255+
if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) {
256256
break;
257257
}
258258
}

0 commit comments

Comments
 (0)