fix(esplora): use saturating_add in update_tx_graph()

This fixes overflow error when calling update_tx_graph() from update_tx_graph_without_keychain().
This commit is contained in:
Steve Myers committed 2023-09-25 21:09:42 -05:00
1 parent 4d1a9fd47a
commit 6a5c9d7a00
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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;
}
}
+1 -1
View File
@@ -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;
}
}