From 0e43ef2792ed362c33f8601d7b33b9105e702db1 Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 6 Sep 2023 09:36:42 +0200 Subject: [PATCH] lnpeer: return fw_info for all parts of a MPP in a trampoline onion Due to an indendation error, fw_info was returned only for one HTLC of the MPP. Thus, maybe_fulfill_htlc was called again with the remaining HTLCs, which could possibly be failed due to MPP timeout, resulting in fund loss for the forwarder. --- electrum/lnpeer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/electrum/lnpeer.py b/electrum/lnpeer.py index 83fa38e6d..98b9a7e70 100644 --- a/electrum/lnpeer.py +++ b/electrum/lnpeer.py @@ -2441,8 +2441,9 @@ class Peer(Logger): # remove from list of payments, so that another attempt can be initiated self.lnworker.final_onion_forwardings.remove(payment_key) asyncio.ensure_future(wrapped_callback()) - fw_info = payment_key.hex() - return None, fw_info, None + # return fw_info so that maybe_fulfill_htlc will not be called again + fw_info = payment_key.hex() + return None, fw_info, None else: # trampoline- HTLC we are supposed to forward, and have already forwarded payment_key_outer_onion = bytes.fromhex(forwarding_info)