]> Untitled Git - bdk/commit
fix(electrum): treat batch_size of 0 as 1
authoryahia008 <yahyatijjani99@gmail.com>
Fri, 9 Oct 2026 13:54:26 +0000 (14:54 +0100)
committer志宇 <hello@evanlinjin.me>
Mon, 19 Oct 2026 02:36:38 +0000 (13:36 +1100)
commit0d8d26c3b1977bd55544eeb064d108046dcf9f67
tree3378f33b943b694dcb46e92c562220d3a8e17f12
parente990ea78e9fd4dd6fbcb1577f43873d9234ab87a
fix(electrum): treat batch_size of 0 as 1

A `batch_size` of 0 made `full_scan` and `sync` skip every request and
return an empty `Ok`, because `populate_with_spks` builds each batch with
`(0..batch_size)` and returns when the batch is empty.

Clamp it to 1 in `populate_with_spks`, document this on `full_scan` and
`sync`, and add a test covering both.

Fixes #2291
crates/electrum/src/bdk_electrum_client.rs
crates/electrum/tests/test_electrum.rs