lnsweep: lnwatcher needs to keep_waiting for pending hold_invoice#10318
Merged
SomberNight merged 2 commits intospesmilo:masterfrom Dec 18, 2025
Merged
lnsweep: lnwatcher needs to keep_waiting for pending hold_invoice#10318SomberNight merged 2 commits intospesmilo:masterfrom
SomberNight merged 2 commits intospesmilo:masterfrom
Conversation
ab388b5 to
b37f54c
Compare
SomberNight
commented
Nov 28, 2025
b37f54c to
5f774dd
Compare
If RHASH is in lnworker.dont_settle_htlcs, we should not reveal the preimage. But also, we should not disregard the htlc either. E.g. during a JIT channel open, payment going A->B->C, C would release the preimage to B (lsp) to cover the costs of the JIT channel-open. If the upstream A->B channel gets force-closed, B should only pull the HTLC's funds if he is sure he can forward them to C. lnwatcher needs to keep watching (i.e. wait) until the RHASH gets removed from lnworker.dont_settle_htlcs, or until the CLTV of the HTLC expires.
5f774dd to
7e1fd00
Compare
f321x
reviewed
Dec 16, 2025
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.
If RHASH is in lnworker.dont_settle_htlcs, we should not reveal
the preimage. But also, we should not disregard the htlc either.
lnwatcher needs to keep waiting until either the user cancels/settles
the hold invoice, or until the hold_invoice's CLTV expires.
TODO: I need to write a test for this!