]> Untitled Git - bdk/commit
fix(rpc): verify fetched mempool tx txids
authorVihiga Tyonum <withtvpeter@gmail.com>
Wed, 16 Sep 2026 06:22:13 +0000 (07:22 +0100)
committer志宇 <hello@evanlinjin.me>
Thu, 15 Oct 2026 03:30:41 +0000 (03:30 +0000)
commit0d6fb41ac4a268675193beee31050343331996f8
treeec5a74dcc956fd03f7af69cff046aeed847e2b20
parente417c43666b2046c3b54efd571521669a4643ea4
fix(rpc): verify fetched mempool tx txids

- Add `tx.compute_txid() == txid` check to validate that fetched raw
mempool transaction hashes against their requested txid before caching
in Emitter::mempool_at. Returns `Error::UnexpectedStructure` for a
mismatch.

- Add a regression test for the above check.

- Document that the crate assumes a trusted `bitcoind` connection, and
that the txid check does not cover witness data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
crates/bitcoind_rpc/src/lib.rs