@@ -49,7 +49,7 @@ fn test_simple_monitor_permanent_update_fail() {
49
49
50
50
let ( route, payment_hash_1, _, payment_secret_1) = get_route_and_payment_hash ! ( & nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
51
51
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 { ..} , { } ) ;
53
53
check_added_monitors ! ( nodes[ 0 ] , 2 ) ;
54
54
55
55
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) {
157
157
chanmon_cfgs[ 0 ] . persister . set_update_ret ( Err ( ChannelMonitorUpdateErr :: TemporaryFailure ) ) ;
158
158
159
159
{
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 , { } ) ;
161
161
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
162
162
}
163
163
@@ -208,7 +208,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
208
208
let ( route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( & nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
209
209
{
210
210
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 , { } ) ;
212
212
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
213
213
}
214
214
@@ -272,7 +272,7 @@ fn do_test_monitor_temporary_update_fail(disconnect_count: usize) {
272
272
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
273
273
{
274
274
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 , { } ) ;
276
276
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
277
277
}
278
278
@@ -609,7 +609,7 @@ fn test_monitor_update_fail_cs() {
609
609
610
610
let ( route, our_payment_hash, payment_preimage, our_payment_secret) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
611
611
{
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 ( ) ;
613
613
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
614
614
}
615
615
@@ -701,7 +701,7 @@ fn test_monitor_update_fail_no_rebroadcast() {
701
701
702
702
let ( route, our_payment_hash, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
703
703
{
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 ( ) ;
705
705
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
706
706
}
707
707
@@ -749,14 +749,14 @@ fn test_monitor_update_raa_while_paused() {
749
749
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 5000000 ) ;
750
750
let ( route, our_payment_hash_1, payment_preimage_1, our_payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
751
751
{
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 ( ) ;
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 ( & 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 ( ) ;
760
760
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
761
761
}
762
762
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) {
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 ( & 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 ( ) ;
849
849
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
850
850
}
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 ( & 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 ( ) ;
874
874
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
875
875
}
876
876
@@ -889,7 +889,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
889
889
let ( payment_preimage_4, payment_hash_4) = if test_ignore_second_cs {
890
890
// Try to route another payment backwards from 2 to make sure 1 holds off on responding
891
891
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 ( ) ;
893
893
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
894
894
895
895
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() {
1181
1181
// requires only an RAA response due to AwaitingRAA) we can deliver the RAA and require the CS
1182
1182
// generation during RAA while in monitor-update-failed state.
1183
1183
{
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 ( ) ;
1185
1185
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 ( ) ;
1187
1187
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
1188
1188
}
1189
1189
@@ -1233,7 +1233,7 @@ fn raa_no_response_awaiting_raa_state() {
1233
1233
// chanmon_fail_consistency test required it to actually find the bug (by seeing out-of-sync
1234
1234
// commitment transaction states) whereas here we can explicitly check for it.
1235
1235
{
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 ( ) ;
1237
1237
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
1238
1238
assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1239
1239
}
@@ -1322,7 +1322,7 @@ fn claim_while_disconnected_monitor_update_fail() {
1322
1322
// the monitor still failed
1323
1323
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1324
1324
{
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 ( ) ;
1326
1326
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1327
1327
}
1328
1328
@@ -1407,7 +1407,7 @@ fn monitor_failed_no_reestablish_response() {
1407
1407
// on receipt).
1408
1408
let ( route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1409
1409
{
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 ( ) ;
1411
1411
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1412
1412
}
1413
1413
@@ -1480,7 +1480,7 @@ fn first_message_on_recv_ordering() {
1480
1480
// can deliver it and fail the monitor update.
1481
1481
let ( route, payment_hash_1, payment_preimage_1, payment_secret_1) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1482
1482
{
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 ( ) ;
1484
1484
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1485
1485
}
1486
1486
@@ -1503,7 +1503,7 @@ fn first_message_on_recv_ordering() {
1503
1503
// Route the second payment, generating an update_add_htlc/commitment_signed
1504
1504
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1505
1505
{
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 ( ) ;
1507
1507
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1508
1508
}
1509
1509
let mut events = nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) ;
@@ -1586,7 +1586,7 @@ fn test_monitor_update_fail_claim() {
1586
1586
1587
1587
let ( route, payment_hash_2, _, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 2 ] , nodes[ 0 ] , 1_000_000 ) ;
1588
1588
{
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 ( ) ;
1590
1590
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1591
1591
}
1592
1592
@@ -1603,7 +1603,7 @@ fn test_monitor_update_fail_claim() {
1603
1603
commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false , true ) ;
1604
1604
1605
1605
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 ( ) ;
1607
1607
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1608
1608
1609
1609
let mut events = nodes[ 2 ] . node . get_and_clear_pending_msg_events ( ) ;
@@ -1693,7 +1693,7 @@ fn test_monitor_update_on_pending_forwards() {
1693
1693
1694
1694
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 2 ] , nodes[ 0 ] , 1000000 ) ;
1695
1695
{
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 ( ) ;
1697
1697
check_added_monitors ! ( nodes[ 2 ] , 1 ) ;
1698
1698
}
1699
1699
@@ -1753,7 +1753,7 @@ fn monitor_update_claim_fail_no_response() {
1753
1753
// Now start forwarding a second payment, skipping the last RAA so B is in AwaitingRAA
1754
1754
let ( route, payment_hash_2, payment_preimage_2, payment_secret_2) = get_route_and_payment_hash ! ( nodes[ 0 ] , nodes[ 1 ] , 1000000 ) ;
1755
1755
{
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 ( ) ;
1757
1757
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
1758
1758
}
1759
1759
@@ -1923,7 +1923,7 @@ fn test_path_paused_mpp() {
1923
1923
// Now check that we get the right return value, indicating that the first path succeeded but
1924
1924
// the second got a MonitorUpdateFailed err. This implies PaymentSendFailure::PartialFailure as
1925
1925
// 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 ) {
1927
1927
assert_eq ! ( results. len( ) , 2 ) ;
1928
1928
if let Ok ( ( ) ) = results[ 0 ] { } else { panic ! ( ) ; }
1929
1929
if let Err ( APIError :: MonitorUpdateFailed ) = results[ 1 ] { } else { panic ! ( ) ; }
@@ -1968,7 +1968,7 @@ fn test_pending_update_fee_ack_on_reconnect() {
1968
1968
send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 100_000_00 ) ;
1969
1969
1970
1970
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 ( ) ;
1972
1972
check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
1973
1973
let bs_initial_send_msgs = get_htlc_update_msgs ! ( nodes[ 1 ] , nodes[ 0 ] . node. get_our_node_id( ) ) ;
1974
1974
// 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) {
2172
2172
// will not be freed from the holding cell.
2173
2173
let ( payment_preimage_0, _, _) = route_payment ( & nodes[ 1 ] , & [ & nodes[ 0 ] ] , 100000 ) ;
2174
2174
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 ( ) ;
2176
2176
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
2177
2177
let send = SendEvent :: from_node ( & nodes[ 0 ] ) ;
2178
2178
assert_eq ! ( send. msgs. len( ) , 1 ) ;
2179
2179
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 ( ) ;
2181
2181
check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
2182
2182
2183
2183
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
2367
2367
// In order to get the HTLC claim into the holding cell at nodes[1], we need nodes[1] to be
2368
2368
// awaiting a remote revoke_and_ack from nodes[0].
2369
2369
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 ( ) ;
2371
2371
check_added_monitors ! ( nodes[ 0 ] , 1 ) ;
2372
2372
2373
2373
let send_event = SendEvent :: from_event ( nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) . remove ( 0 ) ) ;
0 commit comments