Skip to content

Commit 68f0c71

Browse files
authored
Merge pull request #10938 from spesmilo/fail_non_final_onion_with_trampoline_onion
Fail non-final onion containing a trampoline onion
2 parents d532e2a + 7febb41 commit 68f0c71

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

electrum/lnpeer.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2231,6 +2231,9 @@ def _check_unfulfilled_htlc(
22312231
if self.lnworker.maybe_refuse_to_forward_htlc_that_corresponds_to_payreq_we_created(payment_hash):
22322232
_log_fail_reason(f"RHASH corresponds to payreq we created")
22332233
raise OnionRoutingFailure(code=OnionFailureCode.TEMPORARY_NODE_FAILURE, data=b'')
2234+
if processed_onion.trampoline_onion_packet is not None:
2235+
_log_fail_reason(f"found trampoline onion in non-final onion")
2236+
raise OnionRoutingFailure(code=OnionFailureCode.INVALID_ONION_PAYLOAD, data=b'')
22342237
if outer_onion_payment_secret:
22352238
# this is a trampoline forwarding htlc, multiple incoming trampoline htlcs can be collected
22362239
payment_key = (payment_hash + outer_onion_payment_secret).hex()

0 commit comments

Comments
 (0)