@@ -133,7 +133,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
133
133
chanmon_cfgs[ 0 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
134
134
135
135
{
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,
137
137
RecipientOnionFields :: secret_only( payment_secret_1) , PaymentId ( payment_hash_1. 0 )
138
138
) , false , APIError :: MonitorUpdateInProgress , { } ) ;
139
139
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -190,7 +190,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
190
190
let ( route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( & nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
191
191
{
192
192
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,
194
194
RecipientOnionFields :: secret_only( payment_secret_2) , PaymentId ( payment_hash_2. 0 )
195
195
) , false , APIError :: MonitorUpdateInProgress , { } ) ;
196
196
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -257,7 +257,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
257
257
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
258
258
{
259
259
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,
261
261
RecipientOnionFields :: secret_only( payment_secret_2) , PaymentId ( payment_hash_2. 0 )
262
262
) , false , APIError :: MonitorUpdateInProgress , { } ) ;
263
263
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
@@ -607,7 +607,7 @@ fn test_monitor_update_fail_cs() {
607
607
608
608
let ( route, our_payment_hash, payment_preimage, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
609
609
{
610
- nodes[ 0 ] . node . send_payment_with_route ( & route, our_payment_hash,
610
+ nodes[ 0 ] . node . send_payment_with_route ( route, our_payment_hash,
611
611
RecipientOnionFields :: secret_only ( our_payment_secret) , PaymentId ( our_payment_hash. 0 ) ) . unwrap ( ) ;
612
612
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
613
613
}
@@ -700,7 +700,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
700
700
701
701
let ( route, our_payment_hash, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
702
702
{
703
- nodes[ 0 ] . node . send_payment_with_route ( & route, our_payment_hash,
703
+ nodes[ 0 ] . node . send_payment_with_route ( route, our_payment_hash,
704
704
RecipientOnionFields :: secret_only ( payment_secret_1) , PaymentId ( our_payment_hash. 0 ) ) . unwrap ( ) ;
705
705
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
706
706
}
@@ -748,15 +748,15 @@ fn test_monitor_update_raa_while_paused() {
748
748
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 5000000 ) ;
749
749
let ( route, our_payment_hash_1, payment_preimage_1, our_payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
750
750
{
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,
752
752
RecipientOnionFields :: secret_only ( our_payment_secret_1) , PaymentId ( our_payment_hash_1. 0 ) ) . unwrap ( ) ;
753
753
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
754
754
}
755
755
let send_event_1 = SendEvent :: from_event ( nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) . remove ( 0 ) ) ;
756
756
757
757
let ( route, our_payment_hash_2, payment_preimage_2, our_payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 1 ] , nodes[ 0 ] , 1000000 ) ;
758
758
{
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,
760
760
RecipientOnionFields :: secret_only ( our_payment_secret_2) , PaymentId ( our_payment_hash_2. 0 ) ) . unwrap ( ) ;
761
761
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
762
762
}
@@ -845,7 +845,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
845
845
// holding cell.
846
846
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , 1000000 ) ;
847
847
{
848
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_2,
848
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_2,
849
849
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
850
850
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
851
851
}
@@ -870,7 +870,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
870
870
// being paused waiting a monitor update.
871
871
let ( route, payment_hash_3, _, payment_secret_3) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 2 ] , 1000000 ) ;
872
872
{
873
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_3,
873
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_3,
874
874
RecipientOnionFields :: secret_only ( payment_secret_3) , PaymentId ( payment_hash_3. 0 ) ) . unwrap ( ) ;
875
875
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
876
876
}
@@ -890,7 +890,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
890
890
let ( payment_preimage_4, payment_hash_4) = if test_ignore_second_cs {
891
891
// Try to route another payment backwards from 2 to make sure 1 holds off on responding
892
892
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,
894
894
RecipientOnionFields :: secret_only ( payment_secret_4) , PaymentId ( payment_hash_4. 0 ) ) . unwrap ( ) ;
895
895
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
896
896
@@ -1197,10 +1197,10 @@ fn raa_no_response_awaiting_raa_state() {
1197
1197
// requires only an RAA response due to AwaitingRAA) we can deliver the RAA and require the CS
1198
1198
// generation during RAA while in monitor-update-failed state.
1199
1199
{
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,
1201
1201
RecipientOnionFields :: secret_only ( payment_secret_1) , PaymentId ( payment_hash_1. 0 ) ) . unwrap ( ) ;
1202
1202
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,
1204
1204
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1205
1205
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
1206
1206
}
@@ -1250,7 +1250,7 @@ fn raa_no_response_awaiting_raa_state() {
1250
1250
// chanmon_fail_consistency test required it to actually find the bug (by seeing out-of-sync
1251
1251
// commitment transaction states) whereas here we can explicitly check for it.
1252
1252
{
1253
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_3,
1253
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_3,
1254
1254
RecipientOnionFields :: secret_only ( payment_secret_3) , PaymentId ( payment_hash_3. 0 ) ) . unwrap ( ) ;
1255
1255
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
1256
1256
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
@@ -1344,7 +1344,7 @@ fn claim_while_disconnected_monitor_update_fail() {
1344
1344
// the monitor still failed
1345
1345
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1346
1346
{
1347
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_2,
1347
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_2,
1348
1348
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1349
1349
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1350
1350
}
@@ -1440,7 +1440,7 @@ fn monitor_failed_no_reestablish_response() {
1440
1440
// on receipt).
1441
1441
let ( route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1442
1442
{
1443
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_1,
1443
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_1,
1444
1444
RecipientOnionFields :: secret_only ( payment_secret_1) , PaymentId ( payment_hash_1. 0 ) ) . unwrap ( ) ;
1445
1445
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1446
1446
}
@@ -1517,7 +1517,7 @@ fn first_message_on_recv_ordering() {
1517
1517
// can deliver it and fail the monitor update.
1518
1518
let ( route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1519
1519
{
1520
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_1,
1520
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_1,
1521
1521
RecipientOnionFields :: secret_only ( payment_secret_1) , PaymentId ( payment_hash_1. 0 ) ) . unwrap ( ) ;
1522
1522
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1523
1523
}
@@ -1541,7 +1541,7 @@ fn first_message_on_recv_ordering() {
1541
1541
// Route the second payment, generating an update_add_htlc/commitment_signed
1542
1542
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1543
1543
{
1544
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_2,
1544
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_2,
1545
1545
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1546
1546
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1547
1547
}
@@ -1626,7 +1626,7 @@ fn test_monitor_update_fail_claim() {
1626
1626
1627
1627
let ( route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 2 ] , nodes[ 0 ] , 1_000_000 ) ;
1628
1628
{
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,
1630
1630
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1631
1631
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1632
1632
}
@@ -1645,7 +1645,7 @@ fn test_monitor_update_fail_claim() {
1645
1645
expect_pending_htlcs_forwardable_ignore ! ( nodes[ 1 ] ) ;
1646
1646
1647
1647
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,
1649
1649
RecipientOnionFields :: secret_only ( payment_secret_3) , PaymentId ( payment_hash_3. 0 ) ) . unwrap ( ) ;
1650
1650
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1651
1651
@@ -1743,7 +1743,7 @@ fn test_monitor_update_on_pending_forwards() {
1743
1743
1744
1744
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 2 ] , nodes[ 0 ] , 1000000 ) ;
1745
1745
{
1746
- nodes[ 2 ] . node . send_payment_with_route ( & route, payment_hash_2,
1746
+ nodes[ 2 ] . node . send_payment_with_route ( route, payment_hash_2,
1747
1747
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1748
1748
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1749
1749
}
@@ -1808,7 +1808,7 @@ fn monitor_update_claim_fail_no_response() {
1808
1808
// Now start forwarding a second payment, skipping the last RAA so B is in AwaitingRAA
1809
1809
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1810
1810
{
1811
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_2,
1811
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_2,
1812
1812
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
1813
1813
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1814
1814
}
@@ -2007,7 +2007,7 @@ fn test_path_paused_mpp() {
2007
2007
// the second got a MonitorUpdateInProgress err. This implies
2008
2008
// PaymentSendFailure::PartialFailure as some paths succeeded, preventing retry.
2009
2009
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 )
2011
2011
) {
2012
2012
assert_eq ! ( results. len( ) , 2 ) ;
2013
2013
if let Ok ( ( ) ) = results[ 0 ] { } else { panic ! ( ) ; }
@@ -2055,7 +2055,7 @@ fn test_pending_update_fee_ack_on_reconnect() {
2055
2055
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 100_000_00 ) ;
2056
2056
2057
2057
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,
2059
2059
RecipientOnionFields :: secret_only ( payment_secret) , PaymentId ( payment_hash. 0 ) ) . unwrap ( ) ;
2060
2060
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
2061
2061
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) {
2315
2315
// (c) will not be freed from the holding cell.
2316
2316
let ( payment_preimage_0, payment_hash_0, ..) = route_payment ( & nodes[ 1 ] , & [ & nodes[ 0 ] ] , 100_000 ) ;
2317
2317
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,
2319
2319
RecipientOnionFields :: secret_only ( payment_secret_1) , PaymentId ( payment_hash_1. 0 ) ) . unwrap ( ) ;
2320
2320
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
2321
2321
let send = SendEvent :: from_node ( & nodes[ 0 ] ) ;
2322
2322
assert_eq ! ( send. msgs. len( ) , 1 ) ;
2323
2323
2324
- nodes[ 0 ] . node . send_payment_with_route ( & route, payment_hash_2,
2324
+ nodes[ 0 ] . node . send_payment_with_route ( route, payment_hash_2,
2325
2325
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
2326
2326
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
2327
2327
@@ -2494,7 +2494,7 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
2494
2494
// In order to get the HTLC claim into the holding cell at nodes[1], we need nodes[1] to be
2495
2495
// awaiting a remote revoke_and_ack from nodes[0].
2496
2496
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,
2498
2498
RecipientOnionFields :: secret_only ( second_payment_secret) , PaymentId ( second_payment_hash. 0 ) ) . unwrap ( ) ;
2499
2499
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
2500
2500
@@ -3584,7 +3584,7 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
3584
3584
3585
3585
let ( route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( & nodes[ 1 ] , nodes[ 2 ] , 1_000_000 ) ;
3586
3586
3587
- nodes[ 1 ] . node . send_payment_with_route ( & route, payment_hash_2,
3587
+ nodes[ 1 ] . node . send_payment_with_route ( route, payment_hash_2,
3588
3588
RecipientOnionFields :: secret_only ( payment_secret_2) , PaymentId ( payment_hash_2. 0 ) ) . unwrap ( ) ;
3589
3589
check_added_monitors ( & nodes[ 1 ] , 0 ) ;
3590
3590
0 commit comments