]> Untitled Git - bdk/commit
Merge bitcoindevkit/bdk#2349: fix(electrum): return error when tip height overflows u32 master github/master
authormerge-script <hello@evanlinjin.me>
Sun, 18 Oct 2026 14:31:28 +0000 (01:31 +1100)
committermerge-script <hello@evanlinjin.me>
Sun, 18 Oct 2026 14:31:28 +0000 (01:31 +1100)
commit096f5e944aa4bb0bac5b135a25d8fbc6b3721268
tree93e12a9175d8398a08949d88d2fe17441c2a1bf3
parent841b427e6217b794051ff57ebc4f514dffa5f426
parent92ca220ce1c3346af9ec8ab7e36dc4280dc2c385
Merge bitcoindevkit/bdk#2349: fix(electrum): return error when tip height overflows u32

92ca220ce1c3346af9ec8ab7e36dc4280dc2c385 fix(electrum): return error when tip height overflows u32 (bhuvan-somisetty)

Pull request description:

  ### Description

  `fetch_tip_and_latest_blocks` cast the server's `usize` tip height with `height as u32`, so on 64-bit a height above `u32::MAX` was silently truncated. It now uses `u32::try_from` and returns `Error::Message` on overflow.

  Fixes #2294.

  ### Changelog notice

  - Fixed: an overflowing Electrum tip height now returns an error instead of being truncated (#2294).

  ### Checklists

  #### All Submissions:

  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md)

  #### Bugfixes:

  * [ ] This pull request breaks the existing API
  * [ ] 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:
  evanlinjin:
    ACK 92ca220ce1c3346af9ec8ab7e36dc4280dc2c385

Tree-SHA512: 88c9a187c99ba063a07b0f1cbcfe46c05c3b51f8ddb4e0ef6e2e3e3d9da25ec12576d8739c0a6445a36802b4a20554e816e56693680ee1785025ebae45caca43
crates/electrum/src/bdk_electrum_client.rs