@@ -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
0 commit comments