Skip to content

Conversation

@f321x
Copy link
Member

@f321x f321x commented Dec 5, 2025

Deduct the just in time channel opening fees from a htlc sets total amount so htlcs don't get timed out if they come from a just in time channel with opening fee.

Fixes the regtest on master, however trampoline payments might need some additional changes.

Related: #9584

@f321x f321x force-pushed the fix_jit_channel_openings_regtest branch from 48ca037 to b244b68 Compare December 5, 2025 16:35
@f321x f321x marked this pull request as draft December 5, 2025 16:41
Deduct the just in time channel opening fees from the total amount so
htlcs don't get timed out if they come from a just in time channel with
opening fee.

Related: spesmilo#9584

if trampoline_payment_key and trampoline_payment_key != payment_key:
# first stage of trampoline payment, the first stage must never get set COMPLETE
if amount_msat >= any_trampoline_onion.amt_to_forward:
Copy link
Member

Choose a reason for hiding this comment

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

this probably requires the same change as below?

-                if amount_msat >= any_trampoline_onion.amt_to_forward:
+                if amount_msat >= (any_trampoline_onion.amt_to_forward - jit_opening_fees_msat):

@ecdsa ecdsa force-pushed the fix_jit_channel_openings_regtest branch from b244b68 to da99815 Compare December 6, 2025 09:50
@ecdsa ecdsa marked this pull request as ready for review December 6, 2025 09:51
@ecdsa ecdsa merged commit 4d3ead3 into spesmilo:master Dec 6, 2025
13 of 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