@@ -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