]> Untitled Git - bdk/commit
fix(electrum): refresh header cache with headers fetched for the chain update
author志宇 <hello@evanlinjin.me>
Fri, 18 Sep 2026 09:36:19 +0000 (09:36 +0000)
committer志宇 <hello@evanlinjin.me>
Fri, 18 Sep 2026 10:14:26 +0000 (10:14 +0000)
commitb4343702e7da3f3d634559b5cbdb12dbe419c94f
treed1e0a7a5b0ab61cb8df345d9cd1f73ebfaf8a3b5
parente417c43666b2046c3b54efd571521669a4643ea4
fix(electrum): refresh header cache with headers fetched for the chain update

`block_header_cache` was only written by `batch_fetch_anchors`, so after a
reorg it kept serving the pre-reorg header for that height. The anchor
cache is keyed by `(txid, hash)` from that header, so a tx re-mined at the
same height hit the anchor cache with the stale hash, skipped proof
validation, and was never re-anchored to the replacement block.

`fetch_tip_and_latest_blocks` now writes the headers it fetches (the
chain suffix and the agreement-walk checkpoints) into the header cache.
crates/electrum/src/bdk_electrum_client.rs