Skip to content

Commit cd7e5ac

Browse files
committed
Expose payment metadata in the sending path via send_payment.
1 parent 588337f commit cd7e5ac

14 files changed

+129
-130
lines changed

fuzz/src/chanmon_consistency.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ fn send_payment(source: &ChanMan, dest: &ChanMan, dest_chan_id: u64, amt: u64, p
310310
cltv_expiry_delta: 200,
311311
}]],
312312
payment_params: None,
313-
}, payment_hash, &Some(payment_secret)) {
313+
}, payment_hash, &Some(payment_secret), None) {
314314
check_payment_err(err);
315315
false
316316
} else { true }
@@ -336,7 +336,7 @@ fn send_hop_payment(source: &ChanMan, middle: &ChanMan, middle_chan_id: u64, des
336336
cltv_expiry_delta: 200,
337337
}]],
338338
payment_params: None,
339-
}, payment_hash, &Some(payment_secret)) {
339+
}, payment_hash, &Some(payment_secret), None) {
340340
check_payment_err(err);
341341
false
342342
} else { true }

fuzz/src/full_stack.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
463463
sha.input(&payment_hash.0[..]);
464464
payment_hash.0 = Sha256::from_engine(sha).into_inner();
465465
payments_sent += 1;
466-
match channelmanager.send_payment(&route, payment_hash, &None) {
466+
match channelmanager.send_payment(&route, payment_hash, &None, None) {
467467
Ok(_) => {},
468468
Err(_) => return,
469469
}
@@ -490,7 +490,7 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
490490
let mut payment_secret = PaymentSecret([0; 32]);
491491
payment_secret.0[0..8].copy_from_slice(&be64_to_array(payments_sent));
492492
payments_sent += 1;
493-
match channelmanager.send_payment(&route, payment_hash, &Some(payment_secret)) {
493+
match channelmanager.send_payment(&route, payment_hash, &Some(payment_secret), None) {
494494
Ok(_) => {},
495495
Err(_) => return,
496496
}

lightning-invoice/src/payment.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
//! # impl Payer for FakePayer {
6565
//! # fn node_id(&self) -> PublicKey { unimplemented!() }
6666
//! # fn first_hops(&self) -> Vec<ChannelDetails> { unimplemented!() }
67-
//! # fn send_payment(
68-
//! # &self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>
67+
//! # fn send_payment(&self, route: &Route, payment_hash: PaymentHash,
68+
//! # payment_secret: &Option<PaymentSecret>, payment_metadata: Option<Vec<u8>>
6969
//! # ) -> Result<PaymentId, PaymentSendFailure> { unimplemented!() }
7070
//! # fn send_spontaneous_payment(
7171
//! # &self, route: &Route, payment_preimage: PaymentPreimage
@@ -186,8 +186,8 @@ pub trait Payer {
186186
fn first_hops(&self) -> Vec<ChannelDetails>;
187187

188188
/// Sends a payment over the Lightning Network using the given [`Route`].
189-
fn send_payment(
190-
&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>
189+
fn send_payment(&self, route: &Route, payment_hash: PaymentHash,
190+
payment_secret: &Option<PaymentSecret>, payment_metadata: Option<Vec<u8>>
191191
) -> Result<PaymentId, PaymentSendFailure>;
192192

193193
/// Sends a spontaneous payment over the Lightning Network using the given [`Route`].
@@ -309,7 +309,7 @@ where
309309
};
310310

311311
let send_payment = |route: &Route| {
312-
self.payer.send_payment(route, payment_hash, &payment_secret)
312+
self.payer.send_payment(route, payment_hash, &payment_secret, invoice.payment_metadata().cloned())
313313
};
314314
self.pay_internal(&route_params, payment_hash, send_payment)
315315
.map_err(|e| { self.payment_cache.lock().unwrap().remove(&payment_hash); e })
@@ -1463,9 +1463,8 @@ mod tests {
14631463
Vec::new()
14641464
}
14651465

1466-
fn send_payment(
1467-
&self, route: &Route, _payment_hash: PaymentHash,
1468-
_payment_secret: &Option<PaymentSecret>
1466+
fn send_payment(&self, route: &Route, _payment_hash: PaymentHash,
1467+
_payment_secret: &Option<PaymentSecret>, _payment_metadata: Option<Vec<u8>>
14691468
) -> Result<PaymentId, PaymentSendFailure> {
14701469
self.check_value_msats(Amount::ForInvoice(route.get_total_amount()));
14711470
self.check_attempts()

lightning-invoice/src/utils.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -164,10 +164,10 @@ where
164164
self.list_usable_channels()
165165
}
166166

167-
fn send_payment(
168-
&self, route: &Route, payment_hash: PaymentHash, payment_secret: &Option<PaymentSecret>
167+
fn send_payment(&self, route: &Route, payment_hash: PaymentHash,
168+
payment_secret: &Option<PaymentSecret>, payment_metadata: Option<Vec<u8>>
169169
) -> Result<PaymentId, PaymentSendFailure> {
170-
self.send_payment(route, payment_hash, payment_secret)
170+
self.send_payment(route, payment_hash, payment_secret, payment_metadata)
171171
}
172172

173173
fn send_spontaneous_payment(
@@ -236,7 +236,7 @@ mod test {
236236
let payment_event = {
237237
let mut payment_hash = PaymentHash([0; 32]);
238238
payment_hash.0.copy_from_slice(&invoice.payment_hash().as_ref()[0..32]);
239-
nodes[0].node.send_payment(&route, payment_hash, &Some(invoice.payment_secret().clone())).unwrap();
239+
nodes[0].node.send_payment(&route, payment_hash, &Some(invoice.payment_secret().clone()), None).unwrap();
240240
let mut added_monitors = nodes[0].chain_monitor.added_monitors.lock().unwrap();
241241
assert_eq!(added_monitors.len(), 1);
242242
added_monitors.clear();

lightning/src/chain/chainmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,7 @@ mod tests {
901901
// If the ChannelManager tries to update the channel, however, the ChainMonitor will pass
902902
// the update through to the ChannelMonitor which will refuse it (as the channel is closed).
903903
chanmon_cfgs[0].persister.set_update_ret(Ok(()));
904-
unwrap_send_err!(nodes[0].node.send_payment(&route, second_payment_hash, &Some(second_payment_secret)),
904+
unwrap_send_err!(nodes[0].node.send_payment(&route, second_payment_hash, &Some(second_payment_secret), None),
905905
true, APIError::ChannelUnavailable { ref err },
906906
assert!(err.contains("ChannelMonitor storage failure")));
907907
check_added_monitors!(nodes[0], 2); // After the failure we generate a close-channel monitor update

lightning/src/chain/channelmonitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3378,7 +3378,7 @@ mod tests {
33783378
// If the ChannelManager tries to update the channel, however, the ChainMonitor will pass
33793379
// the update through to the ChannelMonitor which will refuse it (as the channel is closed).
33803380
let (route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[1], nodes[0], 100_000);
3381-
unwrap_send_err!(nodes[1].node.send_payment(&route, payment_hash, &Some(payment_secret)),
3381+
unwrap_send_err!(nodes[1].node.send_payment(&route, payment_hash, &Some(payment_secret), None),
33823382
true, APIError::ChannelUnavailable { ref err },
33833383
assert!(err.contains("ChannelMonitor storage failure")));
33843384
check_added_monitors!(nodes[1], 2); // After the failure we generate a close-channel monitor update

lightning/src/ln/chanmon_update_fail_tests.rs

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ fn test_simple_monitor_permanent_update_fail() {
4949

5050
let (route, payment_hash_1, _, payment_secret_1) = get_route_and_payment_hash!(&nodes[0], nodes[1], 1000000);
5151
chanmon_cfgs[0].persister.set_update_ret(Err(ChannelMonitorUpdateErr::PermanentFailure));
52-
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)), true, APIError::ChannelUnavailable {..}, {});
52+
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None), true, APIError::ChannelUnavailable {..}, {});
5353
check_added_monitors!(nodes[0], 2);
5454

5555
let events_1 = nodes[0].node.get_and_clear_pending_msg_events();
@@ -157,7 +157,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
157157
chanmon_cfgs[0].persister.set_update_ret(Err(ChannelMonitorUpdateErr::TemporaryFailure));
158158

159159
{
160-
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)), false, APIError::MonitorUpdateFailed, {});
160+
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None), false, APIError::MonitorUpdateFailed, {});
161161
check_added_monitors!(nodes[0], 1);
162162
}
163163

@@ -208,7 +208,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
208208
let (route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(&nodes[0], nodes[1], 1000000);
209209
{
210210
chanmon_cfgs[0].persister.set_update_ret(Err(ChannelMonitorUpdateErr::TemporaryFailure));
211-
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)), false, APIError::MonitorUpdateFailed, {});
211+
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None), false, APIError::MonitorUpdateFailed, {});
212212
check_added_monitors!(nodes[0], 1);
213213
}
214214

@@ -272,7 +272,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
272272
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
273273
{
274274
chanmon_cfgs[0].persister.set_update_ret(Err(ChannelMonitorUpdateErr::TemporaryFailure));
275-
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)), false, APIError::MonitorUpdateFailed, {});
275+
unwrap_send_err!(nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None), false, APIError::MonitorUpdateFailed, {});
276276
check_added_monitors!(nodes[0], 1);
277277
}
278278

@@ -609,7 +609,7 @@ fn test_monitor_update_fail_cs() {
609609

610610
let (route, our_payment_hash, payment_preimage, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
611611
{
612-
nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret)).unwrap();
612+
nodes[0].node.send_payment(&route, our_payment_hash, &Some(our_payment_secret), None).unwrap();
613613
check_added_monitors!(nodes[0], 1);
614614
}
615615

@@ -701,7 +701,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
701701

702702
let (route, our_payment_hash, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
703703
{
704-
nodes[0].node.send_payment(&route, our_payment_hash, &Some(payment_secret_1)).unwrap();
704+
nodes[0].node.send_payment(&route, our_payment_hash, &Some(payment_secret_1), None).unwrap();
705705
check_added_monitors!(nodes[0], 1);
706706
}
707707

@@ -749,14 +749,14 @@ fn test_monitor_update_raa_while_paused() {
749749
send_payment(&nodes[0], &[&nodes[1]], 5000000);
750750
let (route, our_payment_hash_1, payment_preimage_1, our_payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
751751
{
752-
nodes[0].node.send_payment(&route, our_payment_hash_1, &Some(our_payment_secret_1)).unwrap();
752+
nodes[0].node.send_payment(&route, our_payment_hash_1, &Some(our_payment_secret_1), None).unwrap();
753753
check_added_monitors!(nodes[0], 1);
754754
}
755755
let send_event_1 = SendEvent::from_event(nodes[0].node.get_and_clear_pending_msg_events().remove(0));
756756

757757
let (route, our_payment_hash_2, payment_preimage_2, our_payment_secret_2) = get_route_and_payment_hash!(nodes[1], nodes[0], 1000000);
758758
{
759-
nodes[1].node.send_payment(&route, our_payment_hash_2, &Some(our_payment_secret_2)).unwrap();
759+
nodes[1].node.send_payment(&route, our_payment_hash_2, &Some(our_payment_secret_2), None).unwrap();
760760
check_added_monitors!(nodes[1], 1);
761761
}
762762
let send_event_2 = SendEvent::from_event(nodes[1].node.get_and_clear_pending_msg_events().remove(0));
@@ -845,7 +845,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
845845
// holding cell.
846846
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[2], 1000000);
847847
{
848-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
848+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
849849
check_added_monitors!(nodes[0], 1);
850850
}
851851

@@ -870,7 +870,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
870870
// being paused waiting a monitor update.
871871
let (route, payment_hash_3, _, payment_secret_3) = get_route_and_payment_hash!(nodes[0], nodes[2], 1000000);
872872
{
873-
nodes[0].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3)).unwrap();
873+
nodes[0].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3), None).unwrap();
874874
check_added_monitors!(nodes[0], 1);
875875
}
876876

@@ -889,7 +889,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
889889
let (payment_preimage_4, payment_hash_4) = if test_ignore_second_cs {
890890
// Try to route another payment backwards from 2 to make sure 1 holds off on responding
891891
let (route, payment_hash_4, payment_preimage_4, payment_secret_4) = get_route_and_payment_hash!(nodes[2], nodes[0], 1000000);
892-
nodes[2].node.send_payment(&route, payment_hash_4, &Some(payment_secret_4)).unwrap();
892+
nodes[2].node.send_payment(&route, payment_hash_4, &Some(payment_secret_4), None).unwrap();
893893
check_added_monitors!(nodes[2], 1);
894894

895895
send_event = SendEvent::from_event(nodes[2].node.get_and_clear_pending_msg_events().remove(0));
@@ -1181,9 +1181,9 @@ fn raa_no_response_awaiting_raa_state() {
11811181
// requires only an RAA response due to AwaitingRAA) we can deliver the RAA and require the CS
11821182
// generation during RAA while in monitor-update-failed state.
11831183
{
1184-
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)).unwrap();
1184+
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None).unwrap();
11851185
check_added_monitors!(nodes[0], 1);
1186-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1186+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
11871187
check_added_monitors!(nodes[0], 0);
11881188
}
11891189

@@ -1233,7 +1233,7 @@ fn raa_no_response_awaiting_raa_state() {
12331233
// chanmon_fail_consistency test required it to actually find the bug (by seeing out-of-sync
12341234
// commitment transaction states) whereas here we can explicitly check for it.
12351235
{
1236-
nodes[0].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3)).unwrap();
1236+
nodes[0].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3), None).unwrap();
12371237
check_added_monitors!(nodes[0], 0);
12381238
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
12391239
}
@@ -1322,7 +1322,7 @@ fn claim_while_disconnected_monitor_update_fail() {
13221322
// the monitor still failed
13231323
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
13241324
{
1325-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1325+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
13261326
check_added_monitors!(nodes[0], 1);
13271327
}
13281328

@@ -1407,7 +1407,7 @@ fn monitor_failed_no_reestablish_response() {
14071407
// on receipt).
14081408
let (route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
14091409
{
1410-
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)).unwrap();
1410+
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None).unwrap();
14111411
check_added_monitors!(nodes[0], 1);
14121412
}
14131413

@@ -1480,7 +1480,7 @@ fn first_message_on_recv_ordering() {
14801480
// can deliver it and fail the monitor update.
14811481
let (route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
14821482
{
1483-
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)).unwrap();
1483+
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None).unwrap();
14841484
check_added_monitors!(nodes[0], 1);
14851485
}
14861486

@@ -1503,7 +1503,7 @@ fn first_message_on_recv_ordering() {
15031503
// Route the second payment, generating an update_add_htlc/commitment_signed
15041504
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
15051505
{
1506-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1506+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
15071507
check_added_monitors!(nodes[0], 1);
15081508
}
15091509
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
@@ -1586,7 +1586,7 @@ fn test_monitor_update_fail_claim() {
15861586

15871587
let (route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(nodes[2], nodes[0], 1_000_000);
15881588
{
1589-
nodes[2].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1589+
nodes[2].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
15901590
check_added_monitors!(nodes[2], 1);
15911591
}
15921592

@@ -1603,7 +1603,7 @@ fn test_monitor_update_fail_claim() {
16031603
commitment_signed_dance!(nodes[1], nodes[2], payment_event.commitment_msg, false, true);
16041604

16051605
let (_, payment_hash_3, payment_secret_3) = get_payment_preimage_hash!(nodes[0]);
1606-
nodes[2].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3)).unwrap();
1606+
nodes[2].node.send_payment(&route, payment_hash_3, &Some(payment_secret_3), None).unwrap();
16071607
check_added_monitors!(nodes[2], 1);
16081608

16091609
let mut events = nodes[2].node.get_and_clear_pending_msg_events();
@@ -1693,7 +1693,7 @@ fn test_monitor_update_on_pending_forwards() {
16931693

16941694
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[2], nodes[0], 1000000);
16951695
{
1696-
nodes[2].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1696+
nodes[2].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
16971697
check_added_monitors!(nodes[2], 1);
16981698
}
16991699

@@ -1753,7 +1753,7 @@ fn monitor_update_claim_fail_no_response() {
17531753
// Now start forwarding a second payment, skipping the last RAA so B is in AwaitingRAA
17541754
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
17551755
{
1756-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
1756+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
17571757
check_added_monitors!(nodes[0], 1);
17581758
}
17591759

@@ -1923,7 +1923,7 @@ fn test_path_paused_mpp() {
19231923
// Now check that we get the right return value, indicating that the first path succeeded but
19241924
// the second got a MonitorUpdateFailed err. This implies PaymentSendFailure::PartialFailure as
19251925
// some paths succeeded, preventing retry.
1926-
if let Err(PaymentSendFailure::PartialFailure { results, ..}) = nodes[0].node.send_payment(&route, payment_hash, &Some(payment_secret)) {
1926+
if let Err(PaymentSendFailure::PartialFailure { results, ..}) = nodes[0].node.send_payment(&route, payment_hash, &Some(payment_secret), None) {
19271927
assert_eq!(results.len(), 2);
19281928
if let Ok(()) = results[0] {} else { panic!(); }
19291929
if let Err(APIError::MonitorUpdateFailed) = results[1] {} else { panic!(); }
@@ -1968,7 +1968,7 @@ fn test_pending_update_fee_ack_on_reconnect() {
19681968
send_payment(&nodes[0], &[&nodes[1]], 100_000_00);
19691969

19701970
let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(&nodes[1], nodes[0], 1_000_000);
1971-
nodes[1].node.send_payment(&route, payment_hash, &Some(payment_secret)).unwrap();
1971+
nodes[1].node.send_payment(&route, payment_hash, &Some(payment_secret), None).unwrap();
19721972
check_added_monitors!(nodes[1], 1);
19731973
let bs_initial_send_msgs = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
19741974
// bs_initial_send_msgs are not delivered until they are re-generated after reconnect
@@ -2172,12 +2172,12 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
21722172
// will not be freed from the holding cell.
21732173
let (payment_preimage_0, _, _) = route_payment(&nodes[1], &[&nodes[0]], 100000);
21742174

2175-
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1)).unwrap();
2175+
nodes[0].node.send_payment(&route, payment_hash_1, &Some(payment_secret_1), None).unwrap();
21762176
check_added_monitors!(nodes[0], 1);
21772177
let send = SendEvent::from_node(&nodes[0]);
21782178
assert_eq!(send.msgs.len(), 1);
21792179

2180-
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2)).unwrap();
2180+
nodes[0].node.send_payment(&route, payment_hash_2, &Some(payment_secret_2), None).unwrap();
21812181
check_added_monitors!(nodes[0], 0);
21822182

21832183
chanmon_cfgs[0].persister.set_update_ret(Err(ChannelMonitorUpdateErr::TemporaryFailure));
@@ -2367,7 +2367,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
23672367
// In order to get the HTLC claim into the holding cell at nodes[1], we need nodes[1] to be
23682368
// awaiting a remote revoke_and_ack from nodes[0].
23692369
let (route, second_payment_hash, _, second_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 100_000);
2370-
nodes[0].node.send_payment(&route, second_payment_hash, &Some(second_payment_secret)).unwrap();
2370+
nodes[0].node.send_payment(&route, second_payment_hash, &Some(second_payment_secret), None).unwrap();
23712371
check_added_monitors!(nodes[0], 1);
23722372

23732373
let send_event = SendEvent::from_event(nodes[0].node.get_and_clear_pending_msg_events().remove(0));

0 commit comments

Comments
 (0)