]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#2236: feat(core): add non-consuming SyncRequest iterators
authormerge-script <hello@evanlinjin.me>
Mon, 19 Oct 2026 11:53:58 +0000 (22:53 +1100)
committermerge-script <hello@evanlinjin.me>
Mon, 19 Oct 2026 11:53:58 +0000 (22:53 +1100)
commitb693b36d165984d1af0ce51506fce249c4c882eb
treed360e8f3d0539de1e5a3c9689d915ddea65ada33
parent634b42cf068dd5daeb5730059f229c01d2148709
parentb3a3087823a51c2dc2e87ae6fc29716a7e5c5028
Merge bitcoindevkit/bdk#2236: feat(core): add non-consuming SyncRequest iterators

b3a3087823a51c2dc2e87ae6fc29716a7e5c5028 feat(core): split SyncRequest consuming and read-only iterators (Alok)

Pull request description:

  ### Description

  `SyncRequest`'s `iter_*` methods drain the request despite their names, and there is no way to inspect pending items without consuming them. This PR, as proposed in #2220:

  - Adds read-only `spks()`, `txids()` and `outpoints()`.
  - Adds consuming `drain_spks_with_expected_txids()`, `drain_txids()` and `drain_outpoints()`.
  - Deprecates `iter_spks_with_expected_txids()`, `iter_txids()` and `iter_outpoints()` as wrappers around the `drain_*` methods, so existing callers keep working.
  - Moves the electrum and esplora call sites to `drain_*`.

  No new tests: the behaviour is evident from the signatures.

  Fixes #2220

  ### Changelog notice

  ### Added
  - `SyncRequest::spks`, `SyncRequest::txids` and `SyncRequest::outpoints` for read-only access to pending sync items.
  - `SyncRequest::drain_spks_with_expected_txids`, `SyncRequest::drain_txids` and `SyncRequest::drain_outpoints` for consuming iteration.

  ### Deprecated
  - `SyncRequest::iter_spks_with_expected_txids`, `SyncRequest::iter_txids` and `SyncRequest::iter_outpoints`; use the `drain_*` methods, or the read-only accessors.

  ### Checklists
  **All Submissions**
  - [x] I followed the contribution guidelines.

  **New Features**
  - [ ] I've added tests for the new feature.
  - [x] I've added docs for the new feature.

ACKs for top commit:
  evanlinjin:
    ACK b3a3087823a51c2dc2e87ae6fc29716a7e5c5028

Tree-SHA512: afb94312fe4adf42beb344a3885c1d799a5d3ba866f1ab11c653da88b597d86af069b322781dc09c453fb59253c2c63fb4da8f214038815862ea24fb3f94e774