@@ -222,6 +222,12 @@ pub enum PendingHTLCRouting {
222222 /// [`Event::PaymentClaimable::onion_fields`] as
223223 /// [`RecipientOnionFields::sender_custom_tlvs`].
224224 sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
225+ /// Custom TLVs set by the receiver in the blinded path used to reach them.
226+ ///
227+ /// For HTLCs received by LDK, this will be exposed in
228+ /// [`Event::PaymentClaimable::onion_fields`] as
229+ /// [`RecipientOnionFields::user_custom_data`].
230+ user_custom_data: Option<Vec<u8>>,
225231 /// Set if this HTLC is the final hop in a multi-hop blinded path.
226232 requires_blinded_error: bool,
227233 },
@@ -252,6 +258,11 @@ pub enum PendingHTLCRouting {
252258 /// For HTLCs received by LDK, these will ultimately bubble back up as
253259 /// [`RecipientOnionFields::sender_custom_tlvs`].
254260 sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
261+ /// Custom TLVs set by the receiver in the blinded path used to reach them.
262+ ///
263+ /// For HTLCs received by LDK, these will ultimately bubble back up as
264+ /// [`RecipientOnionFields::user_custom_data`].
265+ user_custom_data: Option<Vec<u8>>,
255266 /// Set if this HTLC is the final hop in a multi-hop blinded path.
256267 requires_blinded_error: bool,
257268 /// Set if we are receiving a keysend to a blinded path, meaning we created the
@@ -6119,24 +6130,25 @@ where
61196130 PendingHTLCRouting::Receive {
61206131 payment_data, payment_metadata, payment_context,
61216132 incoming_cltv_expiry, phantom_shared_secret, sender_custom_tlvs,
6122- requires_blinded_error: _
6133+ user_custom_data, requires_blinded_error: _
61236134 } => {
61246135 let _legacy_hop_data = Some(payment_data.clone());
61256136 let onion_fields = RecipientOnionFields { payment_secret: Some(payment_data.payment_secret),
6126- payment_metadata, sender_custom_tlvs };
6137+ payment_metadata, sender_custom_tlvs, user_custom_data };
61276138 (incoming_cltv_expiry, OnionPayload::Invoice { _legacy_hop_data },
61286139 Some(payment_data), payment_context, phantom_shared_secret, onion_fields,
61296140 true, None)
61306141 },
61316142 PendingHTLCRouting::ReceiveKeysend {
61326143 payment_data, payment_preimage, payment_metadata,
6133- incoming_cltv_expiry, sender_custom_tlvs, requires_blinded_error: _ ,
6134- has_recipient_created_payment_secret, payment_context, invoice_request,
6144+ incoming_cltv_expiry, sender_custom_tlvs, user_custom_data ,
6145+ requires_blinded_error: _, has_recipient_created_payment_secret, payment_context, invoice_request,
61356146 } => {
61366147 let onion_fields = RecipientOnionFields {
61376148 payment_secret: payment_data.as_ref().map(|data| data.payment_secret),
61386149 payment_metadata,
61396150 sender_custom_tlvs,
6151+ user_custom_data
61406152 };
61416153 (incoming_cltv_expiry, OnionPayload::Spontaneous(payment_preimage),
61426154 payment_data, payment_context, None, onion_fields,
@@ -10645,7 +10657,7 @@ where
1064510657 /// [`Router::create_blinded_payment_paths`].
1064610658 fn create_blinded_payment_paths(
1064710659 &self, amount_msats: Option<u64>, payment_secret: PaymentSecret, payment_context: PaymentContext,
10648- relative_expiry_seconds: u32
10660+ relative_expiry_seconds: u32,
1064910661 ) -> Result<Vec<BlindedPaymentPath>, ()> {
1065010662 let expanded_key = &self.inbound_payment_key;
1065110663 let entropy = &*self.entropy_source;
@@ -12603,6 +12615,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1260312615 (5, sender_custom_tlvs, optional_vec),
1260412616 (7, requires_blinded_error, (default_value, false)),
1260512617 (9, payment_context, option),
12618+ (11, user_custom_data, option),
1260612619 },
1260712620 (2, ReceiveKeysend) => {
1260812621 (0, payment_preimage, required),
@@ -12612,6 +12625,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1261212625 (4, payment_data, option), // Added in 0.0.116
1261312626 (5, sender_custom_tlvs, optional_vec),
1261412627 (7, has_recipient_created_payment_secret, (default_value, false)),
12628+ (9, user_custom_data, option),
1261512629 (9, payment_context, option),
1261612630 (11, invoice_request, option),
1261712631 },
0 commit comments