@@ -222,6 +222,12 @@ pub enum PendingHTLCRouting {
222
222
/// [`Event::PaymentClaimable::onion_fields`] as
223
223
/// [`RecipientOnionFields::sender_custom_tlvs`].
224
224
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>>,
225
231
/// Set if this HTLC is the final hop in a multi-hop blinded path.
226
232
requires_blinded_error: bool,
227
233
},
@@ -252,6 +258,11 @@ pub enum PendingHTLCRouting {
252
258
/// For HTLCs received by LDK, these will ultimately bubble back up as
253
259
/// [`RecipientOnionFields::sender_custom_tlvs`].
254
260
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>>,
255
266
/// Set if this HTLC is the final hop in a multi-hop blinded path.
256
267
requires_blinded_error: bool,
257
268
/// Set if we are receiving a keysend to a blinded path, meaning we created the
@@ -6119,24 +6130,25 @@ where
6119
6130
PendingHTLCRouting::Receive {
6120
6131
payment_data, payment_metadata, payment_context,
6121
6132
incoming_cltv_expiry, phantom_shared_secret, sender_custom_tlvs,
6122
- requires_blinded_error: _
6133
+ user_custom_data, requires_blinded_error: _
6123
6134
} => {
6124
6135
let _legacy_hop_data = Some(payment_data.clone());
6125
6136
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 };
6127
6138
(incoming_cltv_expiry, OnionPayload::Invoice { _legacy_hop_data },
6128
6139
Some(payment_data), payment_context, phantom_shared_secret, onion_fields,
6129
6140
true, None)
6130
6141
},
6131
6142
PendingHTLCRouting::ReceiveKeysend {
6132
6143
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,
6135
6146
} => {
6136
6147
let onion_fields = RecipientOnionFields {
6137
6148
payment_secret: payment_data.as_ref().map(|data| data.payment_secret),
6138
6149
payment_metadata,
6139
6150
sender_custom_tlvs,
6151
+ user_custom_data
6140
6152
};
6141
6153
(incoming_cltv_expiry, OnionPayload::Spontaneous(payment_preimage),
6142
6154
payment_data, payment_context, None, onion_fields,
@@ -10645,7 +10657,7 @@ where
10645
10657
/// [`Router::create_blinded_payment_paths`].
10646
10658
fn create_blinded_payment_paths(
10647
10659
&self, amount_msats: Option<u64>, payment_secret: PaymentSecret, payment_context: PaymentContext,
10648
- relative_expiry_seconds: u32
10660
+ relative_expiry_seconds: u32,
10649
10661
) -> Result<Vec<BlindedPaymentPath>, ()> {
10650
10662
let expanded_key = &self.inbound_payment_key;
10651
10663
let entropy = &*self.entropy_source;
@@ -12603,6 +12615,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
12603
12615
(5, sender_custom_tlvs, optional_vec),
12604
12616
(7, requires_blinded_error, (default_value, false)),
12605
12617
(9, payment_context, option),
12618
+ (11, user_custom_data, option),
12606
12619
},
12607
12620
(2, ReceiveKeysend) => {
12608
12621
(0, payment_preimage, required),
@@ -12612,6 +12625,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
12612
12625
(4, payment_data, option), // Added in 0.0.116
12613
12626
(5, sender_custom_tlvs, optional_vec),
12614
12627
(7, has_recipient_created_payment_secret, (default_value, false)),
12628
+ (9, user_custom_data, option),
12615
12629
(9, payment_context, option),
12616
12630
(11, invoice_request, option),
12617
12631
},
0 commit comments