Skip to content

Conversation

@SomberNight
Copy link
Member

@SomberNight SomberNight commented Nov 20, 2025

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!

@SomberNight SomberNight force-pushed the 202511_lnsweep_keepwatching branch from b37f54c to 5f774dd Compare December 15, 2025 14:48
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.
@SomberNight SomberNight force-pushed the 202511_lnsweep_keepwatching branch from 5f774dd to 7e1fd00 Compare December 15, 2025 14:54
@SomberNight SomberNight marked this pull request as ready for review December 15, 2025 16:20
Copy link
Member

@f321x f321x left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@SomberNight SomberNight merged commit 308ffb1 into spesmilo:master Dec 18, 2025
16 checks passed
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.

2 participants