Browse Source

lnpeer: MPP receive: require payment_secret for each htlc

BOLT-04 says:
The final node:
  if it supports basic_mpp:
    MUST require payment_secret for all HTLCs in the set

90468030d5/04-onion-routing.md (basic-multi-part-payments)
patch-4
SomberNight 4 years ago
parent
commit
9024419fdc
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 5
      electrum/lnpeer.py

5
electrum/lnpeer.py

@ -1559,7 +1559,10 @@ class Peer(Logger):
try: try:
payment_secret_from_onion = processed_onion.hop_data.payload["payment_data"]["payment_secret"] payment_secret_from_onion = processed_onion.hop_data.payload["payment_data"]["payment_secret"]
except: except:
pass # skip if total_msat > amt_to_forward:
# payment_secret is required for MPP
raise OnionRoutingFailure(code=OnionFailureCode.INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, data=b'')
# TODO fail here if invoice has set PAYMENT_SECRET_REQ
else: else:
if payment_secret_from_onion != derive_payment_secret_from_payment_preimage(preimage): if payment_secret_from_onion != derive_payment_secret_from_payment_preimage(preimage):
raise OnionRoutingFailure(code=OnionFailureCode.INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, data=b'') raise OnionRoutingFailure(code=OnionFailureCode.INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS, data=b'')

Loading…
Cancel
Save