Merge bitcoindevkit/bdk#2053: Remove panic from stop gap scan loop
745f805068ce33ee830b497c28fd37eb4c1aafb1 fix: remove panic from stop gap scan loop (Matthew)
Pull request description:
<!-- You can erase any parts of this template not applicable to your Pull Request. -->
### Description
This PR addresses a panic path in stop gap scan loop. Removes `expect` used to compute gap boundary and instead tracks `consecutive_unused` with `gap_limit = stop_gap.max(1)` to decide when to stop scanning.
Spurred by trying to address https://github.com/bitcoindevkit/bdk_wallet/issues/30 for Esplora
### Notes to the reviewers
Open to any and all feedback on this.
Behavior is unchanged for typical cases, it just avoids a panic in the control flow.
### Changelog notice
```
### Fix:
- Avoid a panic in the Esplora stop‑gap scan loop by tracking consecutive unused scripts to compute the gap boundary.
```
### Checklists
#### All Submissions:
* [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)
#### New Features:
* [ ] I've added tests for the new feature
* [ ] I've added docs for the new feature
#### Bugfixes:
* [ ] This pull request breaks the existing API
* [ ] I've added tests to reproduce the issue which are now passing
* [ ] I'm linking the issue being fixed by this PR
ACKs for top commit:
luisschwab:
ACK
745f805068ce33ee830b497c28fd37eb4c1aafb1
evanlinjin:
ACK
745f805068ce33ee830b497c28fd37eb4c1aafb1
Tree-SHA512: 50b45955d7807996d871453dac61caf1ce25e85d31e261ebd670749b6370e92318d43070147aa67df5b4a904bd9b353b08711e043007c79a125cfd7d9a108da3