Skip to content

Conversation

@TheBlueMatt
Copy link
Collaborator

While I was kinda hoping to also fix #4307 here, the upstream PR (#4342) is much too divergent to backport so instead I think we just don't bother fixing for 0.1.

Electrum's `blockchain.scripthash.get_history` will return the
*confirmed* history for any scripthash, but will then also append any
matching entries from the mempool, with respective `height` fields set
to 0 or -1 (depending on whether all inputs are confirmed or not).

Unfortunately we previously only included a filter for confirmed
`get_history` entries in the watched output case, and forgot to add such
a check also when checking for watched transactions. This would have us
treat the entry as confirmed, then failing on the `get_merkle` step
which of course couldn't prove block inclusion. Here we simply fix this
omission and skip entries that are still unconfirmed (e.g., unconfirmed
funding transactions from 0conf channels).

Signed-off-by: Elias Rohrer <dev@tnull.de>

Backport of cc1eb16
@ldk-reviews-bot
Copy link

ldk-reviews-bot commented Jan 25, 2026

I've assigned @wpaulino as a reviewer!
I'll wait for their review and will help manage the review process.
Once they submit their review, I'll check if a second reviewer would be helpful.

@TheBlueMatt TheBlueMatt force-pushed the 2026-01-0.1-electrum-fix branch from e36a7b2 to d78e8e9 Compare January 25, 2026 22:35
@codecov
Copy link

codecov bot commented Jan 25, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.57%. Comparing base (c4ca3be) to head (f1488d9).

Additional details and impacted files
@@            Coverage Diff             @@
##              0.1    #4343      +/-   ##
==========================================
- Coverage   87.49%   84.57%   -2.93%     
==========================================
  Files         149      135      -14     
  Lines      101924    76539   -25385     
  Branches   101924    76539   -25385     
==========================================
- Hits        89182    64732   -24450     
+ Misses      10476     9766     -710     
+ Partials     2266     2041     -225     

☔ View full report in Codecov by Sentry.
📢 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.

@TheBlueMatt TheBlueMatt force-pushed the 2026-01-0.1-electrum-fix branch 5 times, most recently from 983210c to 787b725 Compare January 26, 2026 12:42
@TheBlueMatt TheBlueMatt force-pushed the 2026-01-0.1-electrum-fix branch from 787b725 to f1488d9 Compare January 26, 2026 13:16
@ldk-reviews-bot
Copy link

👋 The first review has been submitted!

Do you think this PR is ready for a second reviewer? If so, click here to assign a second reviewer.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants