Browse Source

create a trampoline onion when directly paying a trampoline node

master
ThomasV 2 years ago
parent
commit
777c2ffb23
  1. 8
      electrum/lnworker.py
  2. 2
      electrum/trampoline.py

8
electrum/lnworker.py

@ -1968,14 +1968,6 @@ class LNWallet(LNWorker):
# for each trampoline forwarder, construct mpp trampoline
for trampoline_node_id, trampoline_parts in per_trampoline_channel_amounts.items():
per_trampoline_amount = sum([x[1] for x in trampoline_parts])
if trampoline_node_id == paysession.invoice_pubkey:
trampoline_route = None
trampoline_onion = None
per_trampoline_secret = paysession.payment_secret
per_trampoline_amount_with_fees = amount_msat
per_trampoline_cltv_delta = paysession.min_final_cltv_delta
per_trampoline_fees = 0
else:
trampoline_route, trampoline_onion, per_trampoline_amount_with_fees, per_trampoline_cltv_delta = create_trampoline_route_and_onion(
amount_msat=per_trampoline_amount,
total_msat=paysession.amount_to_pay,

2
electrum/trampoline.py

@ -267,7 +267,9 @@ def create_trampoline_route(
# Add final edge. note: eclair requires an encrypted t-onion blob even in legacy case.
# Also needed for fees for last TF!
if route[-1].end_node != invoice_pubkey:
_extend_trampoline_route(route, end_node=invoice_pubkey, trampoline_fee_level=trampoline_fee_level)
# check that we can pay amount and fees
if not is_route_within_budget(
route=route,

Loading…
Cancel
Save