Skip to content

Commit

Permalink
esplora: also fix the gap limit check in the async client
Browse files Browse the repository at this point in the history
  • Loading branch information
darosior committed Nov 24, 2023
1 parent 2c4e90a commit cb713e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion crates/esplora/src/async_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,13 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
}
}

if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) {
let last_index = last_index.expect("Must be set since handles wasn't empty.");
let past_gap_limit = if let Some(i) = last_active_index {
last_index > i.saturating_add(stop_gap as u32)
} else {
last_index >= stop_gap as u32
};
if past_gap_limit {
break;
}
}
Expand Down

0 comments on commit cb713e5

Please sign in to comment.