|
|
|
@ -1804,14 +1804,14 @@ class Peer(Logger): |
|
|
|
# TODO fail here if invoice has set PAYMENT_SECRET_REQ |
|
|
|
# TODO fail here if invoice has set PAYMENT_SECRET_REQ |
|
|
|
payment_secret_from_onion = None |
|
|
|
payment_secret_from_onion = None |
|
|
|
|
|
|
|
|
|
|
|
if total_msat > amt_to_forward: |
|
|
|
payment_status = self.lnworker.check_received_htlc(payment_secret_from_onion, chan.short_channel_id, htlc, total_msat) |
|
|
|
mpp_status = self.lnworker.check_received_mpp_htlc(payment_secret_from_onion, chan.short_channel_id, htlc, total_msat) |
|
|
|
if payment_status is None: |
|
|
|
if mpp_status is None: |
|
|
|
return None, None |
|
|
|
return None, None |
|
|
|
elif payment_status is False: |
|
|
|
if mpp_status is False: |
|
|
|
log_fail_reason(f"MPP_TIMEOUT") |
|
|
|
log_fail_reason(f"MPP_TIMEOUT") |
|
|
|
raise OnionRoutingFailure(code=OnionFailureCode.MPP_TIMEOUT, data=b'') |
|
|
|
raise OnionRoutingFailure(code=OnionFailureCode.MPP_TIMEOUT, data=b'') |
|
|
|
else: |
|
|
|
assert mpp_status is True |
|
|
|
assert payment_status is True |
|
|
|
|
|
|
|
|
|
|
|
# if there is a trampoline_onion, maybe_fulfill_htlc will be called again |
|
|
|
# if there is a trampoline_onion, maybe_fulfill_htlc will be called again |
|
|
|
if processed_onion.trampoline_onion_packet: |
|
|
|
if processed_onion.trampoline_onion_packet: |
|
|
|
|