lnpeer: trampoline forwarding failures may be indexed by outer or inner onion payment secret
This commit is contained in:
@@ -2445,13 +2445,16 @@ class Peer(Logger):
|
|||||||
return None, fw_info, None
|
return None, fw_info, None
|
||||||
else:
|
else:
|
||||||
# trampoline- HTLC we are supposed to forward, and have already forwarded
|
# trampoline- HTLC we are supposed to forward, and have already forwarded
|
||||||
payment_key = bytes.fromhex(forwarding_info)
|
payment_key_outer_onion = bytes.fromhex(forwarding_info)
|
||||||
preimage = self.lnworker.get_preimage(payment_hash)
|
preimage = self.lnworker.get_preimage(payment_hash)
|
||||||
# get (and not pop) failure because the incoming payment might be multi-part
|
payment_secret_inner_onion = self.lnworker.get_payment_secret(payment_hash)
|
||||||
error_reason = self.lnworker.final_onion_forwarding_failures.get(payment_key)
|
payment_key_inner_onion = payment_hash + payment_secret_inner_onion
|
||||||
if error_reason:
|
for payment_key in [payment_key_inner_onion, payment_key_outer_onion]:
|
||||||
self.logger.info(f'trampoline forwarding failure: {error_reason.code_name()}')
|
# get (and not pop) failure because the incoming payment might be multi-part
|
||||||
raise error_reason
|
error_reason = self.lnworker.final_onion_forwarding_failures.get(payment_key)
|
||||||
|
if error_reason:
|
||||||
|
self.logger.info(f'trampoline forwarding failure: {error_reason.code_name()}')
|
||||||
|
raise error_reason
|
||||||
|
|
||||||
elif not forwarding_info:
|
elif not forwarding_info:
|
||||||
# HTLC we are supposed to forward, but haven't forwarded yet
|
# HTLC we are supposed to forward, but haven't forwarded yet
|
||||||
|
|||||||
Reference in New Issue
Block a user