Skip to content

Commit cb713e5

Browse files
committed
esplora: also fix the gap limit check in the async client
1 parent 2c4e90a commit cb713e5

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

crates/esplora/src/async_ext.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,13 @@ impl EsploraAsyncExt for esplora_client::AsyncClient {
259259
}
260260
}
261261

262-
if last_index > last_active_index.map(|i| i.saturating_add(stop_gap as u32)) {
262+
let last_index = last_index.expect("Must be set since handles wasn't empty.");
263+
let past_gap_limit = if let Some(i) = last_active_index {
264+
last_index > i.saturating_add(stop_gap as u32)
265+
} else {
266+
last_index >= stop_gap as u32
267+
};
268+
if past_gap_limit {
263269
break;
264270
}
265271
}

0 commit comments

Comments
 (0)