Browse Source

trampoline: use trampoline policy for intermediate forwarders

patch-4
bitromortac 4 years ago
parent
commit
58dd8996fb
No known key found for this signature in database GPG Key ID: 1965063FC13BEBE2
  1. 14
      electrum/trampoline.py

14
electrum/trampoline.py

@ -186,15 +186,21 @@ def create_trampoline_route(
route[-1].outgoing_node_id = invoice_pubkey
else: # end-to-end trampoline
if r_tag_chosen_for_e2e_trampoline:
pubkey, scid, feebase, feerate, cltv = r_tag_chosen_for_e2e_trampoline
pubkey = r_tag_chosen_for_e2e_trampoline[0]
if route[-1].end_node != pubkey:
# We don't use the forwarding policy from the route hint, which
# is only valid for legacy forwarding. Trampoline forwarders require
# higher fees and cltv deltas.
trampoline_fee_level = trampoline_fee_levels[pubkey]
if trampoline_fee_level < len(TRAMPOLINE_FEES):
fee_policy = TRAMPOLINE_FEES[trampoline_fee_level]
route.append(
TrampolineEdge(
start_node=route[-1].end_node,
end_node=pubkey,
fee_base_msat=feebase,
fee_proportional_millionths=feerate,
cltv_expiry_delta=cltv,
fee_base_msat=fee_policy['fee_base_msat'],
fee_proportional_millionths=fee_policy['fee_proportional_millionths'],
cltv_expiry_delta=fee_policy['cltv_expiry_delta'],
node_features=trampoline_features))
# Final edge (not part of the route if payment is legacy, but eclair requires an encrypted blob)

Loading…
Cancel
Save