Browse Source

lnworker.pay_to_node: skip error handling if sender_idx is None

master
ThomasV 2 years ago
parent
commit
b26f954c2d
  1. 7
      electrum/lnworker.py

7
electrum/lnworker.py

@ -1527,6 +1527,8 @@ class LNWallet(LNWorker):
# if we get a channel update, we might retry the same route and amount
route = htlc_log.route
sender_idx = htlc_log.sender_idx
if sender_idx is None:
raise PaymentFailure(failure_msg.code_name())
erring_node_id = route[sender_idx].node_id
failure_msg = htlc_log.failure_msg
code, data = failure_msg.code, failure_msg.data
@ -1616,9 +1618,6 @@ class LNWallet(LNWorker):
OnionFailureCode.EXPIRY_TOO_SOON: 0,
OnionFailureCode.CHANNEL_DISABLED: 2,
}
if sender_idx is None:
raise PaymentFailure(failure_msg.code_name())
try:
failing_channel = route[sender_idx + 1].short_channel_id
except IndexError:
@ -2353,7 +2352,7 @@ class LNWallet(LNWorker):
onion_key)
except Exception as e:
sender_idx = None
failure_message = OnionRoutingFailure(-1, str(e))
failure_message = OnionRoutingFailure(OnionFailureCode.INVALID_ONION_PAYLOAD, str(e).encode())
else:
# probably got "update_fail_malformed_htlc". well... who to penalise now?
assert failure_message is not None

Loading…
Cancel
Save