Skip to content

Commit 3071bbb

Browse files
Merge pull request #3224 from TheBlueMatt/2024-08-deprecate-send_payment
Mark ChannelManager::send_payment_with_route as deprecated and take `Route` by value
2 parents c7419b4 + 753a7ac commit 3071bbb

13 files changed

+165
-160
lines changed

fuzz/src/chanmon_consistency.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ fn send_payment(
550550
.map(|chan| (chan.next_outbound_htlc_minimum_msat, chan.next_outbound_htlc_limit_msat))
551551
.unwrap_or((0, 0));
552552
if let Err(err) = source.send_payment_with_route(
553-
&Route {
553+
Route {
554554
paths: vec![Path {
555555
hops: vec![RouteHop {
556556
pubkey: dest.get_our_node_id(),
@@ -619,7 +619,7 @@ fn send_hop_payment(
619619
.unwrap_or((0, 0));
620620
let first_hop_fee = 50_000;
621621
if let Err(err) = source.send_payment_with_route(
622-
&Route {
622+
Route {
623623
paths: vec![Path {
624624
hops: vec![
625625
RouteHop {

lightning/src/chain/channelmonitor.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -4902,7 +4902,7 @@ mod tests {
49024902
// If the ChannelManager tries to update the channel, however, the ChainMonitor will pass
49034903
// the update through to the ChannelMonitor which will refuse it (as the channel is closed).
49044904
let (route, payment_hash, _, payment_secret) = get_route_and_payment_hash!(nodes[1], nodes[0], 100_000);
4905-
unwrap_send_err!(nodes[1].node.send_payment_with_route(&route, payment_hash,
4905+
unwrap_send_err!(nodes[1].node.send_payment_with_route(route, payment_hash,
49064906
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)
49074907
), false, APIError::MonitorUpdateInProgress, {});
49084908
check_added_monitors!(nodes[1], 1);

lightning/src/ln/async_signer_tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ fn do_test_async_commitment_signature_for_commitment_signed_revoke_and_ack(enabl
151151
let src = &nodes[0];
152152
let dst = &nodes[1];
153153
let (route, our_payment_hash, _our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(src, dst, 8000000);
154-
src.node.send_payment_with_route(&route, our_payment_hash,
154+
src.node.send_payment_with_route(route, our_payment_hash,
155155
RecipientOnionFields::secret_only(our_payment_secret), PaymentId(our_payment_hash.0)).unwrap();
156156
check_added_monitors!(src, 1);
157157

@@ -333,7 +333,7 @@ fn do_test_async_raa_peer_disconnect(test_case: UnblockSignerAcrossDisconnectCas
333333
let src = &nodes[0];
334334
let dst = &nodes[1];
335335
let (route, our_payment_hash, _our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(src, dst, 8000000);
336-
src.node.send_payment_with_route(&route, our_payment_hash,
336+
src.node.send_payment_with_route(route, our_payment_hash,
337337
RecipientOnionFields::secret_only(our_payment_secret), PaymentId(our_payment_hash.0)).unwrap();
338338
check_added_monitors!(src, 1);
339339

@@ -457,7 +457,7 @@ fn do_test_async_commitment_signature_peer_disconnect(test_case: UnblockSignerAc
457457
let src = &nodes[0];
458458
let dst = &nodes[1];
459459
let (route, our_payment_hash, _our_payment_preimage, our_payment_secret) = get_route_and_payment_hash!(src, dst, 8000000);
460-
src.node.send_payment_with_route(&route, our_payment_hash,
460+
src.node.send_payment_with_route(route, our_payment_hash,
461461
RecipientOnionFields::secret_only(our_payment_secret), PaymentId(our_payment_hash.0)).unwrap();
462462
check_added_monitors!(src, 1);
463463

@@ -574,7 +574,7 @@ fn do_test_async_commitment_signature_ordering(monitor_update_failure: bool) {
574574
// Start to send the second update_add_htlc + commitment_signed, but don't actually make it
575575
// to the peer.
576576
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
577-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
577+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
578578
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
579579
check_added_monitors!(nodes[0], 1);
580580

lightning/src/ln/chanmon_update_fail_tests.rs

+27-27
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
133133
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
134134

135135
{
136-
unwrap_send_err!(nodes[0].node.send_payment_with_route(&route, payment_hash_1,
136+
unwrap_send_err!(nodes[0].node.send_payment_with_route(route, payment_hash_1,
137137
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(payment_hash_1.0)
138138
), false, APIError::MonitorUpdateInProgress, {});
139139
check_added_monitors!(nodes[0], 1);
@@ -190,7 +190,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
190190
let (route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(&nodes[0], nodes[1], 1000000);
191191
{
192192
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
193-
unwrap_send_err!(nodes[0].node.send_payment_with_route(&route, payment_hash_2,
193+
unwrap_send_err!(nodes[0].node.send_payment_with_route(route, payment_hash_2,
194194
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)
195195
), false, APIError::MonitorUpdateInProgress, {});
196196
check_added_monitors!(nodes[0], 1);
@@ -257,7 +257,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
257257
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
258258
{
259259
chanmon_cfgs[0].persister.set_update_ret(ChannelMonitorUpdateStatus::InProgress);
260-
unwrap_send_err!(nodes[0].node.send_payment_with_route(&route, payment_hash_2,
260+
unwrap_send_err!(nodes[0].node.send_payment_with_route(route, payment_hash_2,
261261
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)
262262
), false, APIError::MonitorUpdateInProgress, {});
263263
check_added_monitors!(nodes[0], 1);
@@ -607,7 +607,7 @@ fn test_monitor_update_fail_cs() {
607607

608608
let (route, our_payment_hash, payment_preimage, our_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
609609
{
610-
nodes[0].node.send_payment_with_route(&route, our_payment_hash,
610+
nodes[0].node.send_payment_with_route(route, our_payment_hash,
611611
RecipientOnionFields::secret_only(our_payment_secret), PaymentId(our_payment_hash.0)).unwrap();
612612
check_added_monitors!(nodes[0], 1);
613613
}
@@ -700,7 +700,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
700700

701701
let (route, our_payment_hash, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
702702
{
703-
nodes[0].node.send_payment_with_route(&route, our_payment_hash,
703+
nodes[0].node.send_payment_with_route(route, our_payment_hash,
704704
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(our_payment_hash.0)).unwrap();
705705
check_added_monitors!(nodes[0], 1);
706706
}
@@ -748,15 +748,15 @@ fn test_monitor_update_raa_while_paused() {
748748
send_payment(&nodes[0], &[&nodes[1]], 5000000);
749749
let (route, our_payment_hash_1, payment_preimage_1, our_payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
750750
{
751-
nodes[0].node.send_payment_with_route(&route, our_payment_hash_1,
751+
nodes[0].node.send_payment_with_route(route, our_payment_hash_1,
752752
RecipientOnionFields::secret_only(our_payment_secret_1), PaymentId(our_payment_hash_1.0)).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_with_route(&route, our_payment_hash_2,
759+
nodes[1].node.send_payment_with_route(route, our_payment_hash_2,
760760
RecipientOnionFields::secret_only(our_payment_secret_2), PaymentId(our_payment_hash_2.0)).unwrap();
761761
check_added_monitors!(nodes[1], 1);
762762
}
@@ -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_with_route(&route, payment_hash_2,
848+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
849849
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
850850
check_added_monitors!(nodes[0], 1);
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_with_route(&route, payment_hash_3,
873+
nodes[0].node.send_payment_with_route(route, payment_hash_3,
874874
RecipientOnionFields::secret_only(payment_secret_3), PaymentId(payment_hash_3.0)).unwrap();
875875
check_added_monitors!(nodes[0], 1);
876876
}
@@ -890,7 +890,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
890890
let (payment_preimage_4, payment_hash_4) = if test_ignore_second_cs {
891891
// Try to route another payment backwards from 2 to make sure 1 holds off on responding
892892
let (route, payment_hash_4, payment_preimage_4, payment_secret_4) = get_route_and_payment_hash!(nodes[2], nodes[0], 1000000);
893-
nodes[2].node.send_payment_with_route(&route, payment_hash_4,
893+
nodes[2].node.send_payment_with_route(route, payment_hash_4,
894894
RecipientOnionFields::secret_only(payment_secret_4), PaymentId(payment_hash_4.0)).unwrap();
895895
check_added_monitors!(nodes[2], 1);
896896

@@ -1197,10 +1197,10 @@ fn raa_no_response_awaiting_raa_state() {
11971197
// requires only an RAA response due to AwaitingRAA) we can deliver the RAA and require the CS
11981198
// generation during RAA while in monitor-update-failed state.
11991199
{
1200-
nodes[0].node.send_payment_with_route(&route, payment_hash_1,
1200+
nodes[0].node.send_payment_with_route(route.clone(), payment_hash_1,
12011201
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(payment_hash_1.0)).unwrap();
12021202
check_added_monitors!(nodes[0], 1);
1203-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
1203+
nodes[0].node.send_payment_with_route(route.clone(), payment_hash_2,
12041204
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
12051205
check_added_monitors!(nodes[0], 0);
12061206
}
@@ -1250,7 +1250,7 @@ fn raa_no_response_awaiting_raa_state() {
12501250
// chanmon_fail_consistency test required it to actually find the bug (by seeing out-of-sync
12511251
// commitment transaction states) whereas here we can explicitly check for it.
12521252
{
1253-
nodes[0].node.send_payment_with_route(&route, payment_hash_3,
1253+
nodes[0].node.send_payment_with_route(route, payment_hash_3,
12541254
RecipientOnionFields::secret_only(payment_secret_3), PaymentId(payment_hash_3.0)).unwrap();
12551255
check_added_monitors!(nodes[0], 0);
12561256
assert!(nodes[0].node.get_and_clear_pending_msg_events().is_empty());
@@ -1344,7 +1344,7 @@ fn claim_while_disconnected_monitor_update_fail() {
13441344
// the monitor still failed
13451345
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
13461346
{
1347-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
1347+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
13481348
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
13491349
check_added_monitors!(nodes[0], 1);
13501350
}
@@ -1440,7 +1440,7 @@ fn monitor_failed_no_reestablish_response() {
14401440
// on receipt).
14411441
let (route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
14421442
{
1443-
nodes[0].node.send_payment_with_route(&route, payment_hash_1,
1443+
nodes[0].node.send_payment_with_route(route, payment_hash_1,
14441444
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(payment_hash_1.0)).unwrap();
14451445
check_added_monitors!(nodes[0], 1);
14461446
}
@@ -1517,7 +1517,7 @@ fn first_message_on_recv_ordering() {
15171517
// can deliver it and fail the monitor update.
15181518
let (route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
15191519
{
1520-
nodes[0].node.send_payment_with_route(&route, payment_hash_1,
1520+
nodes[0].node.send_payment_with_route(route, payment_hash_1,
15211521
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(payment_hash_1.0)).unwrap();
15221522
check_added_monitors!(nodes[0], 1);
15231523
}
@@ -1541,7 +1541,7 @@ fn first_message_on_recv_ordering() {
15411541
// Route the second payment, generating an update_add_htlc/commitment_signed
15421542
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
15431543
{
1544-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
1544+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
15451545
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
15461546
check_added_monitors!(nodes[0], 1);
15471547
}
@@ -1626,7 +1626,7 @@ fn test_monitor_update_fail_claim() {
16261626

16271627
let (route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(nodes[2], nodes[0], 1_000_000);
16281628
{
1629-
nodes[2].node.send_payment_with_route(&route, payment_hash_2,
1629+
nodes[2].node.send_payment_with_route(route.clone(), payment_hash_2,
16301630
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
16311631
check_added_monitors!(nodes[2], 1);
16321632
}
@@ -1645,7 +1645,7 @@ fn test_monitor_update_fail_claim() {
16451645
expect_pending_htlcs_forwardable_ignore!(nodes[1]);
16461646

16471647
let (_, payment_hash_3, payment_secret_3) = get_payment_preimage_hash!(nodes[0]);
1648-
nodes[2].node.send_payment_with_route(&route, payment_hash_3,
1648+
nodes[2].node.send_payment_with_route(route, payment_hash_3,
16491649
RecipientOnionFields::secret_only(payment_secret_3), PaymentId(payment_hash_3.0)).unwrap();
16501650
check_added_monitors!(nodes[2], 1);
16511651

@@ -1743,7 +1743,7 @@ fn test_monitor_update_on_pending_forwards() {
17431743

17441744
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[2], nodes[0], 1000000);
17451745
{
1746-
nodes[2].node.send_payment_with_route(&route, payment_hash_2,
1746+
nodes[2].node.send_payment_with_route(route, payment_hash_2,
17471747
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
17481748
check_added_monitors!(nodes[2], 1);
17491749
}
@@ -1808,7 +1808,7 @@ fn monitor_update_claim_fail_no_response() {
18081808
// Now start forwarding a second payment, skipping the last RAA so B is in AwaitingRAA
18091809
let (route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash!(nodes[0], nodes[1], 1000000);
18101810
{
1811-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
1811+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
18121812
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
18131813
check_added_monitors!(nodes[0], 1);
18141814
}
@@ -2007,7 +2007,7 @@ fn test_path_paused_mpp() {
20072007
// the second got a MonitorUpdateInProgress err. This implies
20082008
// PaymentSendFailure::PartialFailure as some paths succeeded, preventing retry.
20092009
if let Err(PaymentSendFailure::PartialFailure { results, ..}) = nodes[0].node.send_payment_with_route(
2010-
&route, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)
2010+
route, payment_hash, RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)
20112011
) {
20122012
assert_eq!(results.len(), 2);
20132013
if let Ok(()) = results[0] {} else { panic!(); }
@@ -2055,7 +2055,7 @@ fn test_pending_update_fee_ack_on_reconnect() {
20552055
send_payment(&nodes[0], &[&nodes[1]], 100_000_00);
20562056

20572057
let (route, payment_hash, payment_preimage, payment_secret) = get_route_and_payment_hash!(&nodes[1], nodes[0], 1_000_000);
2058-
nodes[1].node.send_payment_with_route(&route, payment_hash,
2058+
nodes[1].node.send_payment_with_route(route, payment_hash,
20592059
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap();
20602060
check_added_monitors!(nodes[1], 1);
20612061
let bs_initial_send_msgs = get_htlc_update_msgs!(nodes[1], nodes[0].node.get_our_node_id());
@@ -2315,13 +2315,13 @@ fn do_channel_holding_cell_serialize(disconnect: bool, reload_a: bool) {
23152315
// (c) will not be freed from the holding cell.
23162316
let (payment_preimage_0, payment_hash_0, ..) = route_payment(&nodes[1], &[&nodes[0]], 100_000);
23172317

2318-
nodes[0].node.send_payment_with_route(&route, payment_hash_1,
2318+
nodes[0].node.send_payment_with_route(route.clone(), payment_hash_1,
23192319
RecipientOnionFields::secret_only(payment_secret_1), PaymentId(payment_hash_1.0)).unwrap();
23202320
check_added_monitors!(nodes[0], 1);
23212321
let send = SendEvent::from_node(&nodes[0]);
23222322
assert_eq!(send.msgs.len(), 1);
23232323

2324-
nodes[0].node.send_payment_with_route(&route, payment_hash_2,
2324+
nodes[0].node.send_payment_with_route(route, payment_hash_2,
23252325
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
23262326
check_added_monitors!(nodes[0], 0);
23272327

@@ -2494,7 +2494,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
24942494
// In order to get the HTLC claim into the holding cell at nodes[1], we need nodes[1] to be
24952495
// awaiting a remote revoke_and_ack from nodes[0].
24962496
let (route, second_payment_hash, _, second_payment_secret) = get_route_and_payment_hash!(nodes[0], nodes[1], 100_000);
2497-
nodes[0].node.send_payment_with_route(&route, second_payment_hash,
2497+
nodes[0].node.send_payment_with_route(route, second_payment_hash,
24982498
RecipientOnionFields::secret_only(second_payment_secret), PaymentId(second_payment_hash.0)).unwrap();
24992499
check_added_monitors!(nodes[0], 1);
25002500

@@ -3584,7 +3584,7 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
35843584

35853585
let (route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash!(&nodes[1], nodes[2], 1_000_000);
35863586

3587-
nodes[1].node.send_payment_with_route(&route, payment_hash_2,
3587+
nodes[1].node.send_payment_with_route(route, payment_hash_2,
35883588
RecipientOnionFields::secret_only(payment_secret_2), PaymentId(payment_hash_2.0)).unwrap();
35893589
check_added_monitors(&nodes[1], 0);
35903590

lightning/src/ln/channelmanager.rs

+9-4
Original file line numberDiff line numberDiff line change
@@ -4093,6 +4093,10 @@ where
40934093

40944094
/// Sends a payment along a given route.
40954095
///
4096+
/// This method is *DEPRECATED*, use [`Self::send_payment`] instead. If you wish to fix the
4097+
/// route for a payment, do so by matching the [`PaymentId`] passed to
4098+
/// [`Router::find_route_with_id`].
4099+
///
40964100
/// Value parameters are provided via the last hop in route, see documentation for [`RouteHop`]
40974101
/// fields for more info.
40984102
///
@@ -4142,11 +4146,12 @@ where
41424146
/// [`UpdateHTLCs`]: events::MessageSendEvent::UpdateHTLCs
41434147
/// [`PeerManager::process_events`]: crate::ln::peer_handler::PeerManager::process_events
41444148
/// [`ChannelMonitorUpdateStatus::InProgress`]: crate::chain::ChannelMonitorUpdateStatus::InProgress
4145-
pub fn send_payment_with_route(&self, route: &Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_id: PaymentId) -> Result<(), PaymentSendFailure> {
4149+
#[cfg_attr(not(any(test, feature = "_test_utils")), deprecated(note = "Use `send_payment` instead"))]
4150+
pub fn send_payment_with_route(&self, route: Route, payment_hash: PaymentHash, recipient_onion: RecipientOnionFields, payment_id: PaymentId) -> Result<(), PaymentSendFailure> {
41464151
let best_block_height = self.best_block.read().unwrap().height;
41474152
let _persistence_guard = PersistenceNotifierGuard::notify_on_drop(self);
41484153
self.pending_outbound_payments
4149-
.send_payment_with_route(route, payment_hash, recipient_onion, payment_id,
4154+
.send_payment_with_route(&route, payment_hash, recipient_onion, payment_id,
41504155
&self.entropy_source, &self.node_signer, best_block_height,
41514156
|args| self.send_payment_along_path(args))
41524157
}
@@ -13003,7 +13008,7 @@ mod tests {
1300313008

1300413009
// Next, attempt a regular payment and make sure it fails.
1300513010
let payment_secret = PaymentSecret([43; 32]);
13006-
nodes[0].node.send_payment_with_route(&route, payment_hash,
13011+
nodes[0].node.send_payment_with_route(route.clone(), payment_hash,
1300713012
RecipientOnionFields::secret_only(payment_secret), PaymentId(payment_hash.0)).unwrap();
1300813013
check_added_monitors!(nodes[0], 1);
1300913014
let mut events = nodes[0].node.get_and_clear_pending_msg_events();
@@ -13190,7 +13195,7 @@ mod tests {
1319013195
route.paths[1].hops[0].short_channel_id = chan_2_id;
1319113196
route.paths[1].hops[1].short_channel_id = chan_4_id;
1319213197

13193-
match nodes[0].node.send_payment_with_route(&route, payment_hash,
13198+
match nodes[0].node.send_payment_with_route(route, payment_hash,
1319413199
RecipientOnionFields::spontaneous_empty(), PaymentId(payment_hash.0))
1319513200
.unwrap_err() {
1319613201
PaymentSendFailure::ParameterError(APIError::APIMisuseError { ref err }) => {

0 commit comments

Comments
 (0)