Skip to content

fix(electrum): propagate transport errors when syncing outpoints - #2325

Open
chaitika wants to merge 2 commits into
bitcoindevkit:masterfrom
chaitika:fix/electrum-outpoint-fetch-errors
Open

chaitika wants to merge 2 commits into
bitcoindevkit:masterfrom
chaitika:fix/electrum-outpoint-fetch-errors

Conversation

@chaitika

Copy link
Copy Markdown

Description

Fixes #2293

populate_with_outpoints discarded every fetch_tx error, so a connection/TLS/timeout failure made sync return Ok without data for the outpoint.

It now skips only on Error::Protocol and propagates other errors, matching populate_with_txids.

Changelog notice

  • bdk_electrum: sync now returns an error instead of silently skipping an outpoint when fetching its transaction fails for a non-protocol reason

Checklists

All Submissions:

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

`populate_with_outpoints` discarded every error returned by `fetch_tx`,
so a connection, TLS or timeout failure made `sync` report success
without any data for the requested outpoint. A spend of that outpoint
was then missed and the UTXO kept being treated as unspent.

Skip the outpoint only on `Error::Protocol` and propagate all other
errors, matching `populate_with_txids`.
Add a regression test: syncing an outpoint against a server that drops
the connection must return an error instead of an empty successful
update.
@chaitika

Copy link
Copy Markdown
Author

@noahjoeris PTAL at this, thanks!

@codecov

codecov Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 33.33333% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.98%. Comparing base (e417c43) to head (edbf4a3).
⚠️ Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
crates/electrum/src/bdk_electrum_client.rs 33.33% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2325      +/-   ##
==========================================
+ Coverage   78.84%   78.98%   +0.13%     
==========================================
  Files          31       31              
  Lines        6060     6062       +2     
  Branches      288      287       -1     
==========================================
+ Hits         4778     4788      +10     
+ Misses       1203     1195       -8     
  Partials       79       79              
Flag Coverage Δ
rust 78.98% <33.33%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Electrum outpoint sync silently ignores transaction fetch errors

1 participant