From: Alekos Filini Date: Tue, 5 Jul 2022 10:30:15 +0000 (+0200) Subject: Merge bitcoindevkit/bdk#652: Fix: Hang when `ElectrumBlockchainConfig::stop_gap ... X-Git-Tag: 0.20.0~12 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/enum.FileStoreError.html?a=commitdiff_plain;h=0e92820af4e934bbf104d88577bd47e318aecb38;p=bdk Merge bitcoindevkit/bdk#652: Fix: Hang when `ElectrumBlockchainConfig::stop_gap == 0` 612da165f8cfbc2b0aee0a37b2cdc44d6da017c8 `Blockchain` stop_gap testing improvements (志宇) 8a5f89e129d421a41af02ea85383d5b82f5ff665 Fix hang when `ElectrumBlockchainConfig::stop_gap == 0` (志宇) Pull request description: * Ensure `chunk_size` is > 0 during wallet sync. * Slight refactoring for better readability. * Add test: `test_electrum_blockchain_factory_sync_with_stop_gaps` ### Description `Wallet::sync` hangs indefinitely when syncing with Electrum with `stop_gap` set as 0. The culprit is having `chunk_size` set as `stop_gap`. A zero value results in syncing not being able to progress. Fixes #651 ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: ~* [ ] This pull request breaks the existing API~ * [x] I've added tests to reproduce the issue which are now passing * [x] I'm linking the issue being fixed by this PR ACKs for top commit: afilini: ACK 612da165f8cfbc2b0aee0a37b2cdc44d6da017c8 Tree-SHA512: 56f1bff788855facc21856209922594cff9f639c5c58ecd180a0493322a75a564b72ded330ab0b6d6c90007ce859d2b8a5d2870d619bae5ddf9a3d64837f3753 --- 0e92820af4e934bbf104d88577bd47e318aecb38