Skip to content

Commit 17e3756

Browse files
committed
Rename custom_tlvs -> sender_custom_tlvs
1 parent 2a0f78a commit 17e3756

13 files changed

+199
-204
lines changed

lightning/src/events/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -705,15 +705,15 @@ pub enum Event {
705705
/// [`ChannelManager::fail_htlc_backwards`] or [`ChannelManager::fail_htlc_backwards_with_reason`]
706706
/// to free up resources for this HTLC and avoid network congestion.
707707
///
708-
/// If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes custom TLVs with even type
708+
/// If [`Event::PaymentClaimable::onion_fields`] is `Some`, and includes sender custom TLVs with even type
709709
/// numbers, you should use [`ChannelManager::fail_htlc_backwards_with_reason`] with
710710
/// [`FailureCode::InvalidOnionPayload`] if you fail to understand and handle the contents, or
711-
/// [`ChannelManager::claim_funds_with_known_custom_tlvs`] upon successful handling.
712-
/// If you don't intend to check for custom TLVs, you can simply use
713-
/// [`ChannelManager::claim_funds`], which will automatically fail back even custom TLVs.
711+
/// [`ChannelManager::claim_funds_with_known_sender_custom_tlvs`] upon successful handling.
712+
/// If you don't intend to check for sender custom TLVs, you can simply use
713+
/// [`ChannelManager::claim_funds`], which will automatically fail back even sender custom TLVs.
714714
///
715715
/// If you fail to call [`ChannelManager::claim_funds`],
716-
/// [`ChannelManager::claim_funds_with_known_custom_tlvs`],
716+
/// [`ChannelManager::claim_funds_with_known_sender_custom_tlvs`],
717717
/// [`ChannelManager::fail_htlc_backwards`], or
718718
/// [`ChannelManager::fail_htlc_backwards_with_reason`] within the HTLC's timeout, the HTLC will
719719
/// be automatically failed.
@@ -732,7 +732,7 @@ pub enum Event {
732732
/// returning `Err(ReplayEvent ())`) and will be persisted across restarts.
733733
///
734734
/// [`ChannelManager::claim_funds`]: crate::ln::channelmanager::ChannelManager::claim_funds
735-
/// [`ChannelManager::claim_funds_with_known_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_custom_tlvs
735+
/// [`ChannelManager::claim_funds_with_known_sender_custom_tlvs`]: crate::ln::channelmanager::ChannelManager::claim_funds_with_known_sender_custom_tlvs
736736
/// [`FailureCode::InvalidOnionPayload`]: crate::ln::channelmanager::FailureCode::InvalidOnionPayload
737737
/// [`ChannelManager::fail_htlc_backwards`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards
738738
/// [`ChannelManager::fail_htlc_backwards_with_reason`]: crate::ln::channelmanager::ChannelManager::fail_htlc_backwards_with_reason

lightning/src/ln/async_payments_tests.rs

-7
Original file line numberDiff line numberDiff line change
@@ -305,13 +305,6 @@ fn ignore_unexpected_static_invoice() {
305305
create_announced_chan_between_nodes_with_value(&nodes, 0, 1, 1_000_000, 0);
306306
create_unannounced_chan_between_nodes_with_value(&nodes, 1, 2, 1_000_000, 0);
307307

308-
let recipient_tlvs = ReceiveTlvs {
309-
context: Some(MessageContext::Offers(OffersContext::InvoiceRequest {
310-
nonce: Nonce([42; 16]),
311-
})),
312-
custom_data: None,
313-
};
314-
315308
// Initiate payment to the sender's intended offer.
316309
let (offer, valid_static_invoice) =
317310
create_static_invoice(&nodes[1], &nodes[2], None, &secp_ctx);

lightning/src/ln/blinded_payment_tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ fn conditionally_round_fwd_amt() {
12831283

12841284

12851285
#[test]
1286-
fn custom_tlvs_to_blinded_path() {
1286+
fn sender_custom_tlvs_to_blinded_path() {
12871287
let chanmon_cfgs = create_chanmon_cfgs(2);
12881288
let node_cfgs = create_node_cfgs(2, &chanmon_cfgs);
12891289
let node_chanmgrs = create_node_chanmgrs(2, &node_cfgs, &[None, None]);
@@ -1315,7 +1315,7 @@ fn custom_tlvs_to_blinded_path() {
13151315
);
13161316

13171317
let recipient_onion_fields = RecipientOnionFields::spontaneous_empty()
1318-
.with_custom_tlvs(vec![((1 << 16) + 1, vec![42, 42])])
1318+
.with_sender_custom_tlvs(vec![((1 << 16) + 1, vec![42, 42])])
13191319
.unwrap();
13201320
nodes[0].node.send_payment(payment_hash, recipient_onion_fields.clone(),
13211321
PaymentId(payment_hash.0), route_params, Retry::Attempts(0)).unwrap();
@@ -1328,11 +1328,11 @@ fn custom_tlvs_to_blinded_path() {
13281328
let path = &[&nodes[1]];
13291329
let args = PassAlongPathArgs::new(&nodes[0], path, amt_msat, payment_hash, ev)
13301330
.with_payment_secret(payment_secret)
1331-
.with_custom_tlvs(recipient_onion_fields.custom_tlvs.clone());
1331+
.with_sender_custom_tlvs(recipient_onion_fields.sender_custom_tlvs.clone());
13321332
do_pass_along_path(args);
13331333
claim_payment_along_route(
13341334
ClaimAlongRouteArgs::new(&nodes[0], &[&[&nodes[1]]], payment_preimage)
1335-
.with_custom_tlvs(recipient_onion_fields.custom_tlvs.clone())
1335+
.with_sender_custom_tlvs(recipient_onion_fields.sender_custom_tlvs.clone())
13361336
);
13371337
}
13381338

lightning/src/ln/channelmanager.rs

+31-31
Original file line numberDiff line numberDiff line change
@@ -216,12 +216,12 @@ pub enum PendingHTLCRouting {
216216
/// provide the onion shared secret used to decrypt the next level of forwarding
217217
/// instructions.
218218
phantom_shared_secret: Option<[u8; 32]>,
219-
/// Custom TLVs which were set by the sender.
219+
/// Sender custom TLVs which were set by the sender.
220220
///
221221
/// For HTLCs received by LDK, this will ultimately be exposed in
222222
/// [`Event::PaymentClaimable::onion_fields`] as
223-
/// [`RecipientOnionFields::custom_tlvs`].
224-
custom_tlvs: Vec<(u64, Vec<u8>)>,
223+
/// [`RecipientOnionFields::sender_custom_tlvs`].
224+
sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
225225
/// Set if this HTLC is the final hop in a multi-hop blinded path.
226226
requires_blinded_error: bool,
227227
},
@@ -247,11 +247,11 @@ pub enum PendingHTLCRouting {
247247
///
248248
/// Used to track when we should expire pending HTLCs that go unclaimed.
249249
incoming_cltv_expiry: u32,
250-
/// Custom TLVs which were set by the sender.
250+
/// Sender custom TLVs which were set by the sender.
251251
///
252252
/// For HTLCs received by LDK, these will ultimately bubble back up as
253-
/// [`RecipientOnionFields::custom_tlvs`].
254-
custom_tlvs: Vec<(u64, Vec<u8>)>,
253+
/// [`RecipientOnionFields::sender_custom_tlvs`].
254+
sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
255255
/// Set if this HTLC is the final hop in a multi-hop blinded path.
256256
requires_blinded_error: bool,
257257
/// Set if we are receiving a keysend to a blinded path, meaning we created the
@@ -984,17 +984,17 @@ struct ClaimablePayments {
984984
impl ClaimablePayments {
985985
/// Moves a payment from [`Self::claimable_payments`] to [`Self::pending_claiming_payments`].
986986
///
987-
/// If `custom_tlvs_known` is false and custom even TLVs are set by the sender, the set of
987+
/// If `sender_custom_tlvs_known` is false and custom even TLVs are set by the sender, the set of
988988
/// pending HTLCs will be returned in the `Err` variant of this method. They MUST then be
989989
/// failed by the caller as they will not be in either [`Self::claimable_payments`] or
990990
/// [`Self::pending_claiming_payments`].
991991
///
992-
/// If `custom_tlvs_known` is true, and a matching payment is found, it will always be moved.
992+
/// If `sender_custom_tlvs_known` is true, and a matching payment is found, it will always be moved.
993993
///
994994
/// If no payment is found, `Err(Vec::new())` is returned.
995995
fn begin_claiming_payment<L: Deref, S: Deref>(
996996
&mut self, payment_hash: PaymentHash, node_signer: &S, logger: &L,
997-
inbound_payment_id_secret: &[u8; 32], custom_tlvs_known: bool,
997+
inbound_payment_id_secret: &[u8; 32], sender_custom_tlvs_known: bool,
998998
) -> Result<(Vec<ClaimableHTLC>, ClaimingPayment), Vec<ClaimableHTLC>>
999999
where L::Target: Logger, S::Target: NodeSigner,
10001000
{
@@ -1011,10 +1011,10 @@ impl ClaimablePayments {
10111011
}
10121012
}
10131013

1014-
if let Some(RecipientOnionFields { custom_tlvs, .. }) = &payment.onion_fields {
1015-
if !custom_tlvs_known && custom_tlvs.iter().any(|(typ, _)| typ % 2 == 0) {
1014+
if let Some(RecipientOnionFields { sender_custom_tlvs, .. }) = &payment.onion_fields {
1015+
if !sender_custom_tlvs_known && sender_custom_tlvs.iter().any(|(typ, _)| typ % 2 == 0) {
10161016
log_info!(logger, "Rejecting payment with payment hash {} as we cannot accept payment with unknown even TLVs: {}",
1017-
&payment_hash, log_iter!(custom_tlvs.iter().map(|(typ, _)| typ).filter(|typ| *typ % 2 == 0)));
1017+
&payment_hash, log_iter!(sender_custom_tlvs.iter().map(|(typ, _)| typ).filter(|typ| *typ % 2 == 0)));
10181018
return Err(payment.htlcs);
10191019
}
10201020
}
@@ -6118,25 +6118,25 @@ where
61186118
) = match routing {
61196119
PendingHTLCRouting::Receive {
61206120
payment_data, payment_metadata, payment_context,
6121-
incoming_cltv_expiry, phantom_shared_secret, custom_tlvs,
6121+
incoming_cltv_expiry, phantom_shared_secret, sender_custom_tlvs,
61226122
requires_blinded_error: _
61236123
} => {
61246124
let _legacy_hop_data = Some(payment_data.clone());
61256125
let onion_fields = RecipientOnionFields { payment_secret: Some(payment_data.payment_secret),
6126-
payment_metadata, custom_tlvs };
6126+
payment_metadata, sender_custom_tlvs };
61276127
(incoming_cltv_expiry, OnionPayload::Invoice { _legacy_hop_data },
61286128
Some(payment_data), payment_context, phantom_shared_secret, onion_fields,
61296129
true, None)
61306130
},
61316131
PendingHTLCRouting::ReceiveKeysend {
61326132
payment_data, payment_preimage, payment_metadata,
6133-
incoming_cltv_expiry, custom_tlvs, requires_blinded_error: _,
6133+
incoming_cltv_expiry, sender_custom_tlvs, requires_blinded_error: _,
61346134
has_recipient_created_payment_secret, payment_context, invoice_request,
61356135
} => {
61366136
let onion_fields = RecipientOnionFields {
61376137
payment_secret: payment_data.as_ref().map(|data| data.payment_secret),
61386138
payment_metadata,
6139-
custom_tlvs,
6139+
sender_custom_tlvs,
61406140
};
61416141
(incoming_cltv_expiry, OnionPayload::Spontaneous(payment_preimage),
61426142
payment_data, payment_context, None, onion_fields,
@@ -7001,22 +7001,22 @@ where
70017001
/// event matches your expectation. If you fail to do so and call this method, you may provide
70027002
/// the sender "proof-of-payment" when they did not fulfill the full expected payment.
70037003
///
7004-
/// This function will fail the payment if it has custom TLVs with even type numbers, as we
7005-
/// will assume they are unknown. If you intend to accept even custom TLVs, you should use
7006-
/// [`claim_funds_with_known_custom_tlvs`].
7004+
/// This function will fail the payment if it has sender custom TLVs with even type numbers, as we
7005+
/// will assume they are unknown. If you intend to accept even sender custom TLVs, you should use
7006+
/// [`claim_funds_with_known_sender_custom_tlvs`].
70077007
///
70087008
/// [`Event::PaymentClaimable`]: crate::events::Event::PaymentClaimable
70097009
/// [`Event::PaymentClaimable::claim_deadline`]: crate::events::Event::PaymentClaimable::claim_deadline
70107010
/// [`Event::PaymentClaimed`]: crate::events::Event::PaymentClaimed
70117011
/// [`process_pending_events`]: EventsProvider::process_pending_events
70127012
/// [`create_inbound_payment`]: Self::create_inbound_payment
70137013
/// [`create_inbound_payment_for_hash`]: Self::create_inbound_payment_for_hash
7014-
/// [`claim_funds_with_known_custom_tlvs`]: Self::claim_funds_with_known_custom_tlvs
7014+
/// [`claim_funds_with_known_sender_custom_tlvs`]: Self::claim_funds_with_known_sender_custom_tlvs
70157015
pub fn claim_funds(&self, payment_preimage: PaymentPreimage) {
70167016
self.claim_payment_internal(payment_preimage, false);
70177017
}
70187018

7019-
/// This is a variant of [`claim_funds`] that allows accepting a payment with custom TLVs with
7019+
/// This is a variant of [`claim_funds`] that allows accepting a payment with sender custom TLVs with
70207020
/// even type numbers.
70217021
///
70227022
/// # Note
@@ -7025,19 +7025,19 @@ where
70257025
/// claim, otherwise you may unintentionally agree to some protocol you do not understand.
70267026
///
70277027
/// [`claim_funds`]: Self::claim_funds
7028-
pub fn claim_funds_with_known_custom_tlvs(&self, payment_preimage: PaymentPreimage) {
7028+
pub fn claim_funds_with_known_sender_custom_tlvs(&self, payment_preimage: PaymentPreimage) {
70297029
self.claim_payment_internal(payment_preimage, true);
70307030
}
70317031

7032-
fn claim_payment_internal(&self, payment_preimage: PaymentPreimage, custom_tlvs_known: bool) {
7032+
fn claim_payment_internal(&self, payment_preimage: PaymentPreimage, sender_custom_tlvs_known: bool) {
70337033
let payment_hash = PaymentHash(Sha256::hash(&payment_preimage.0).to_byte_array());
70347034

70357035
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
70367036

70377037
let (sources, claiming_payment) = {
70387038
let res = self.claimable_payments.lock().unwrap().begin_claiming_payment(
70397039
payment_hash, &self.node_signer, &self.logger, &self.inbound_payment_id_secret,
7040-
custom_tlvs_known,
7040+
sender_custom_tlvs_known,
70417041
);
70427042

70437043
match res {
@@ -12600,7 +12600,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1260012600
(1, phantom_shared_secret, option),
1260112601
(2, incoming_cltv_expiry, required),
1260212602
(3, payment_metadata, option),
12603-
(5, custom_tlvs, optional_vec),
12603+
(5, sender_custom_tlvs, optional_vec),
1260412604
(7, requires_blinded_error, (default_value, false)),
1260512605
(9, payment_context, option),
1260612606
},
@@ -12610,7 +12610,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1261012610
(2, incoming_cltv_expiry, required),
1261112611
(3, payment_metadata, option),
1261212612
(4, payment_data, option), // Added in 0.0.116
12613-
(5, custom_tlvs, optional_vec),
12613+
(5, sender_custom_tlvs, optional_vec),
1261412614
(7, has_recipient_created_payment_secret, (default_value, false)),
1261512615
(9, payment_context, option),
1261612616
(11, invoice_request, option),
@@ -12629,7 +12629,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1262912629
(1, phantom_shared_secret, option),
1263012630
(2, incoming_cltv_expiry, required),
1263112631
(3, payment_metadata, option),
12632-
(5, custom_tlvs, optional_vec),
12632+
(5, sender_custom_tlvs, optional_vec),
1263312633
(7, requires_blinded_error, (default_value, false)),
1263412634
(9, payment_context, option),
1263512635
},
@@ -12639,7 +12639,7 @@ impl_writeable_tlv_based_enum!(PendingHTLCRouting,
1263912639
(2, incoming_cltv_expiry, required),
1264012640
(3, payment_metadata, option),
1264112641
(4, payment_data, option), // Added in 0.0.116
12642-
(5, custom_tlvs, optional_vec),
12642+
(5, sender_custom_tlvs, optional_vec),
1264312643
(7, has_recipient_created_payment_secret, (default_value, false)),
1264412644
(9, payment_context, option),
1264512645
(11, invoice_request, option),
@@ -15771,7 +15771,7 @@ mod tests {
1577115771
payment_secret: PaymentSecret([0; 32]),
1577215772
total_msat: sender_intended_amt_msat,
1577315773
}),
15774-
custom_tlvs: Vec::new(),
15774+
sender_custom_tlvs: Vec::new(),
1577515775
});
1577615776
// Check that if the amount we received + the penultimate hop extra fee is less than the sender
1577715777
// intended amount, we fail the payment.
@@ -15794,7 +15794,7 @@ mod tests {
1579415794
payment_secret: PaymentSecret([0; 32]),
1579515795
total_msat: sender_intended_amt_msat,
1579615796
}),
15797-
custom_tlvs: Vec::new(),
15797+
sender_custom_tlvs: Vec::new(),
1579815798
});
1579915799
let current_height: u32 = node[0].node.best_block.read().unwrap().height;
1580015800
assert!(create_recv_pending_htlc_info(hop_data, [0; 32], PaymentHash([0; 32]),
@@ -15819,7 +15819,7 @@ mod tests {
1581915819
payment_secret: PaymentSecret([0; 32]),
1582015820
total_msat: 100,
1582115821
}),
15822-
custom_tlvs: Vec::new(),
15822+
sender_custom_tlvs: Vec::new(),
1582315823
}), [0; 32], PaymentHash([0; 32]), 100, 23, None, true, None, current_height);
1582415824

1582515825
// Should not return an error as this condition:

lightning/src/ln/functional_test_utils.rs

+13-13
Original file line numberDiff line numberDiff line change
@@ -2658,7 +2658,7 @@ pub struct PassAlongPathArgs<'a, 'b, 'c, 'd> {
26582658
pub clear_recipient_events: bool,
26592659
pub expected_preimage: Option<PaymentPreimage>,
26602660
pub is_probe: bool,
2661-
pub custom_tlvs: Vec<(u64, Vec<u8>)>,
2661+
pub sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
26622662
pub payment_metadata: Option<Vec<u8>>,
26632663
pub expected_failure: Option<HTLCDestination>,
26642664
}
@@ -2671,7 +2671,7 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
26712671
Self {
26722672
origin_node, expected_path, recv_value, payment_hash, payment_secret: None, event,
26732673
payment_claimable_expected: true, clear_recipient_events: true, expected_preimage: None,
2674-
is_probe: false, custom_tlvs: Vec::new(), payment_metadata: None, expected_failure: None,
2674+
is_probe: false, sender_custom_tlvs: Vec::new(), payment_metadata: None, expected_failure: None,
26752675
}
26762676
}
26772677
pub fn without_clearing_recipient_events(mut self) -> Self {
@@ -2695,8 +2695,8 @@ impl<'a, 'b, 'c, 'd> PassAlongPathArgs<'a, 'b, 'c, 'd> {
26952695
self.expected_preimage = Some(payment_preimage);
26962696
self
26972697
}
2698-
pub fn with_custom_tlvs(mut self, custom_tlvs: Vec<(u64, Vec<u8>)>) -> Self {
2699-
self.custom_tlvs = custom_tlvs;
2698+
pub fn with_sender_custom_tlvs(mut self, sender_custom_tlvs: Vec<(u64, Vec<u8>)>) -> Self {
2699+
self.sender_custom_tlvs = sender_custom_tlvs;
27002700
self
27012701
}
27022702
pub fn with_payment_metadata(mut self, payment_metadata: Vec<u8>) -> Self {
@@ -2714,7 +2714,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(args: PassAlongPathArgs) -> Option<Event>
27142714
let PassAlongPathArgs {
27152715
origin_node, expected_path, recv_value, payment_hash: our_payment_hash,
27162716
payment_secret: our_payment_secret, event: ev, payment_claimable_expected,
2717-
clear_recipient_events, expected_preimage, is_probe, custom_tlvs, payment_metadata,
2717+
clear_recipient_events, expected_preimage, is_probe, sender_custom_tlvs, payment_metadata,
27182718
expected_failure
27192719
} = args;
27202720

@@ -2750,7 +2750,7 @@ pub fn do_pass_along_path<'a, 'b, 'c>(args: PassAlongPathArgs) -> Option<Event>
27502750
assert_eq!(our_payment_hash, *payment_hash);
27512751
assert_eq!(node.node.get_our_node_id(), receiver_node_id.unwrap());
27522752
assert!(onion_fields.is_some());
2753-
assert_eq!(onion_fields.as_ref().unwrap().custom_tlvs, custom_tlvs);
2753+
assert_eq!(onion_fields.as_ref().unwrap().sender_custom_tlvs, sender_custom_tlvs);
27542754
assert_eq!(onion_fields.as_ref().unwrap().payment_metadata, payment_metadata);
27552755
match &purpose {
27562756
PaymentPurpose::Bolt11InvoicePayment { payment_preimage, payment_secret, .. } => {
@@ -2881,7 +2881,7 @@ pub struct ClaimAlongRouteArgs<'a, 'b, 'c, 'd> {
28812881
pub expected_min_htlc_overpay: Vec<u32>,
28822882
pub skip_last: bool,
28832883
pub payment_preimage: PaymentPreimage,
2884-
pub custom_tlvs: Vec<(u64, Vec<u8>)>,
2884+
pub sender_custom_tlvs: Vec<(u64, Vec<u8>)>,
28852885
// Allow forwarding nodes to have taken 1 msat more fee than expected based on the downstream
28862886
// fulfill amount.
28872887
//
@@ -2900,7 +2900,7 @@ impl<'a, 'b, 'c, 'd> ClaimAlongRouteArgs<'a, 'b, 'c, 'd> {
29002900
Self {
29012901
origin_node, expected_paths, expected_extra_fees: vec![0; expected_paths.len()],
29022902
expected_min_htlc_overpay: vec![0; expected_paths.len()], skip_last: false, payment_preimage,
2903-
allow_1_msat_fee_overpay: false, custom_tlvs: vec![],
2903+
allow_1_msat_fee_overpay: false, sender_custom_tlvs: vec![],
29042904
}
29052905
}
29062906
pub fn skip_last(mut self, skip_last: bool) -> Self {
@@ -2919,16 +2919,16 @@ impl<'a, 'b, 'c, 'd> ClaimAlongRouteArgs<'a, 'b, 'c, 'd> {
29192919
self.allow_1_msat_fee_overpay = true;
29202920
self
29212921
}
2922-
pub fn with_custom_tlvs(mut self, custom_tlvs: Vec<(u64, Vec<u8>)>) -> Self {
2923-
self.custom_tlvs = custom_tlvs;
2922+
pub fn with_sender_custom_tlvs(mut self, sender_custom_tlvs: Vec<(u64, Vec<u8>)>) -> Self {
2923+
self.sender_custom_tlvs = sender_custom_tlvs;
29242924
self
29252925
}
29262926
}
29272927

29282928
pub fn pass_claimed_payment_along_route(args: ClaimAlongRouteArgs) -> u64 {
29292929
let ClaimAlongRouteArgs {
29302930
origin_node, expected_paths, expected_extra_fees, expected_min_htlc_overpay, skip_last,
2931-
payment_preimage: our_payment_preimage, allow_1_msat_fee_overpay, custom_tlvs,
2931+
payment_preimage: our_payment_preimage, allow_1_msat_fee_overpay, sender_custom_tlvs,
29322932
} = args;
29332933
let claim_event = expected_paths[0].last().unwrap().node.get_and_clear_pending_events();
29342934
assert_eq!(claim_event.len(), 1);
@@ -2948,7 +2948,7 @@ pub fn pass_claimed_payment_along_route(args: ClaimAlongRouteArgs) -> u64 {
29482948
assert_eq!(preimage, our_payment_preimage);
29492949
assert_eq!(htlcs.len(), expected_paths.len()); // One per path.
29502950
assert_eq!(htlcs.iter().map(|h| h.value_msat).sum::<u64>(), amount_msat);
2951-
assert_eq!(onion_fields.as_ref().unwrap().custom_tlvs, custom_tlvs);
2951+
assert_eq!(onion_fields.as_ref().unwrap().sender_custom_tlvs, sender_custom_tlvs);
29522952
check_claimed_htlcs_match_route(origin_node, expected_paths, htlcs);
29532953
fwd_amt_msat = amount_msat;
29542954
},
@@ -2965,7 +2965,7 @@ pub fn pass_claimed_payment_along_route(args: ClaimAlongRouteArgs) -> u64 {
29652965
assert_eq!(&payment_hash.0, &Sha256::hash(&our_payment_preimage.0)[..]);
29662966
assert_eq!(htlcs.len(), expected_paths.len()); // One per path.
29672967
assert_eq!(htlcs.iter().map(|h| h.value_msat).sum::<u64>(), amount_msat);
2968-
assert_eq!(onion_fields.as_ref().unwrap().custom_tlvs, custom_tlvs);
2968+
assert_eq!(onion_fields.as_ref().unwrap().sender_custom_tlvs, sender_custom_tlvs);
29692969
check_claimed_htlcs_match_route(origin_node, expected_paths, htlcs);
29702970
fwd_amt_msat = amount_msat;
29712971
}

0 commit comments

Comments
 (0)