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 2023-09-04 00:25:38 -05:00
parent 4d1a9fd47a
commit 6a5c9d7a00
No known key found for this signature in database
GPG Key ID: 8105A46B22C2D051
2 changed files with 2 additions and 2 deletions

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;
}
}

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;
}
}