Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add mechanism to block htlcs from settling back #9586

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

f321x
Copy link
Member

@f321x f321x commented Feb 28, 2025

Required for #9584
Adds a persisted dictionary of htlc keys (= result of serialize_htlc_key()) to lnworker to allow adding htlcs which should not be settled back even if we got the required preimage to do so.
Currently if we open a JIT channel and get the preimage from the client we concurrently settle the incoming htlc to us, however we may still want to fail it in the process of opening the JIT channel which is not finished yet, for example if we were unable to broadcast the funding tx. With this change we can block the settling until the forwarding callback has returned.
Also fixes a key error exception that happened if the incoming htlc got settled before the callback returned, wrapped_callback then tried to access active_forwardings[payment_key] which has already been removed after settling the incoming htlc.

@f321x f321x force-pushed the jit-block-preimage branch from 2f97643 to f28add9 Compare February 28, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant