From: merge-script Date: Tue, 3 Mar 2026 03:41:59 +0000 (+0000) Subject: Merge bitcoindevkit/bdk#2053: Remove panic from stop gap scan loop X-Git-Url: http://internal-gitweb-vhost/parse/src/example_cli/%22https:/enum.LockTime.html?a=commitdiff_plain;h=HEAD;p=bdk Merge bitcoindevkit/bdk#2053: Remove panic from stop gap scan loop 745f805068ce33ee830b497c28fd37eb4c1aafb1 fix: remove panic from stop gap scan loop (Matthew) Pull request description: ### 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 --- 01d0dd3b842f29d9dd167227f707d418ddb39036