Skip to content

Commit 4a0170a

Browse files
Support forwarding blinded HTLCs as non-intro node.
Error handling will be completed in upcoming commit(s).
1 parent 62d52c6 commit 4a0170a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lightning/src/ln/msgs.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1714,7 +1714,7 @@ mod fuzzy_internal_msgs {
17141714
payment_relay: PaymentRelay,
17151715
payment_constraints: PaymentConstraints,
17161716
features: BlindedHopFeatures,
1717-
intro_node_blinding_point: PublicKey,
1717+
intro_node_blinding_point: Option<PublicKey>,
17181718
},
17191719
BlindedReceive {
17201720
sender_intended_htlc_amt_msat: u64,
@@ -2394,7 +2394,7 @@ impl<NS: Deref> ReadableArgs<(Option<PublicKey>, &NS)> for InboundOnionPayload w
23942394
payment_relay,
23952395
payment_constraints,
23962396
features,
2397-
intro_node_blinding_point: intro_node_blinding_point.ok_or(DecodeError::InvalidValue)?,
2397+
intro_node_blinding_point,
23982398
})
23992399
},
24002400
ChaChaPolyReadAdapter { readable: BlindedPaymentTlvs::Receive(ReceiveTlvs {

lightning/src/ln/onion_payment.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub(super) fn create_fwd_pending_htlc_info(
7373
};
7474

7575
let (
76-
short_channel_id, amt_to_forward, outgoing_cltv_value, inbound_blinding_point
76+
short_channel_id, amt_to_forward, outgoing_cltv_value, intro_node_blinding_point
7777
) = match hop_data {
7878
msgs::InboundOnionPayload::Forward { short_channel_id, amt_to_forward, outgoing_cltv_value } =>
7979
(short_channel_id, amt_to_forward, outgoing_cltv_value, None),
@@ -91,7 +91,7 @@ pub(super) fn create_fwd_pending_htlc_info(
9191
err_data: vec![0; 32],
9292
}
9393
})?;
94-
(short_channel_id, amt_to_forward, outgoing_cltv_value, Some(intro_node_blinding_point))
94+
(short_channel_id, amt_to_forward, outgoing_cltv_value, intro_node_blinding_point)
9595
},
9696
msgs::InboundOnionPayload::Receive { .. } | msgs::InboundOnionPayload::BlindedReceive { .. } =>
9797
return Err(InboundHTLCErr {
@@ -105,7 +105,8 @@ pub(super) fn create_fwd_pending_htlc_info(
105105
routing: PendingHTLCRouting::Forward {
106106
onion_packet: outgoing_packet,
107107
short_channel_id,
108-
blinded: inbound_blinding_point.map(|bp| BlindedForward { inbound_blinding_point: bp }),
108+
blinded: intro_node_blinding_point.or(msg.blinding_point)
109+
.map(|bp| BlindedForward { inbound_blinding_point: bp }),
109110
},
110111
payment_hash: msg.payment_hash,
111112
incoming_shared_secret: shared_secret,

0 commit comments

Comments
 (0)