From 143b8b361580bcb47b2d7f499a9dcc78cb126f8b Mon Sep 17 00:00:00 2001 From: Valentine Wallace Date: Wed, 27 Mar 2024 16:41:25 -0400 Subject: [PATCH] Support receiving custom TLVs to blinded paths. --- lightning/src/ln/msgs.rs | 2 ++ lightning/src/ln/onion_payment.rs | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lightning/src/ln/msgs.rs b/lightning/src/ln/msgs.rs index 89dff4920..2088c51fb 100644 --- a/lightning/src/ln/msgs.rs +++ b/lightning/src/ln/msgs.rs @@ -1701,6 +1701,7 @@ mod fuzzy_internal_msgs { payment_constraints: PaymentConstraints, intro_node_blinding_point: Option, keysend_preimage: Option, + custom_tlvs: Vec<(u64, Vec)>, } } @@ -2683,6 +2684,7 @@ impl ReadableArgs<(Option, &NS)> for InboundOnionPayload w payment_constraints, intro_node_blinding_point, keysend_preimage, + custom_tlvs, }) }, } diff --git a/lightning/src/ln/onion_payment.rs b/lightning/src/ln/onion_payment.rs index 8a721a861..a5560e280 100644 --- a/lightning/src/ln/onion_payment.rs +++ b/lightning/src/ln/onion_payment.rs @@ -139,7 +139,7 @@ pub(super) fn create_recv_pending_htlc_info( cltv_expiry_height, payment_metadata, false), msgs::InboundOnionPayload::BlindedReceive { sender_intended_htlc_amt_msat, total_msat, cltv_expiry_height, payment_secret, - intro_node_blinding_point, payment_constraints, keysend_preimage, .. + intro_node_blinding_point, payment_constraints, keysend_preimage, custom_tlvs } => { check_blinded_payment_constraints( sender_intended_htlc_amt_msat, cltv_expiry, &payment_constraints @@ -152,7 +152,7 @@ pub(super) fn create_recv_pending_htlc_info( } })?; let payment_data = msgs::FinalOnionHopData { payment_secret, total_msat }; - (Some(payment_data), keysend_preimage, Vec::new(), + (Some(payment_data), keysend_preimage, custom_tlvs, sender_intended_htlc_amt_msat, cltv_expiry_height, None, intro_node_blinding_point.is_none()) } -- 2.39.5