lnchannel: extract_preimage: fix len(witness) check - #10906
Open
f321x wants to merge 1 commit into
Open
Conversation
f321x
force-pushed
the
fix_lnchannel_preimage_extraction
branch
5 times, most recently
from
August 28, 2026 15:00
4c3f609 to
46b1938
Compare
f321x
marked this pull request as ready for review
August 28, 2026 15:20
Member
Author
|
The security review CI finding is addressed by #10910 |
SomberNight
added a commit
to SomberNight/electrum
that referenced
this pull request
Aug 28, 2026
Member
|
Thanks! Looks excellent. I merged all but the last commit, in d698389. |
f321x
force-pushed
the
fix_lnchannel_preimage_extraction
branch
from
August 31, 2026 09:19
46b1938 to
835d6eb
Compare
ecdsa
reviewed
Aug 31, 2026
| keep_watching |= self._sweep_ctx_output(prevout, sweep_info, chan, closing_tx, is_local_ctx) | ||
| except Exception as e: | ||
| # in case a single sweep crashes we keep sweeping the other outputs | ||
| send_exception_to_crash_reporter(e) # logs too |
Member
There was a problem hiding this comment.
I would remove that; see my comment in the other PR.
Catch exceptions occuring during the sweep of a single ctx output and keep going sweeping the other outputs so we sweep at least those that do not crash and don't leave them on the table.
f321x
force-pushed
the
fix_lnchannel_preimage_extraction
branch
from
August 31, 2026 13:55
835d6eb to
df8fd78
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Channel.extract_preimage_from_htlc_txin()would incorrectly assume a htlc revocation spends revocationpubkey to be the preimage of the htlc and then fail at the comparison against the payment hash.This happened because the preimage was selected solely based on the length of the spending txin witness which consists of 3 elements both for the preimage spend path and the revocation spend path.
This PR takes over @SomberNight's b0650f1 commit as fix and adds some additional commits.