@@ -220,7 +220,7 @@ fn do_test_simple_monitor_temporary_update_fail(disconnect: bool) {
220220 let payment_event = SendEvent :: from_event ( events_2. pop ( ) . unwrap ( ) ) ;
221221 assert_eq ! ( payment_event. node_id, node_b_id) ;
222222 nodes[ 1 ] . node . handle_update_add_htlc ( node_a_id, & payment_event. msgs [ 0 ] ) ;
223- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , payment_event. commitment_msg, false ) ;
223+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & payment_event. commitment_msg , false , false ) ;
224224
225225 expect_and_process_pending_htlcs ( & nodes[ 1 ] , false ) ;
226226
@@ -1021,7 +1021,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
10211021 let mut send_event =
10221022 SendEvent :: from_event ( nodes[ 0 ] . node . get_and_clear_pending_msg_events ( ) . remove ( 0 ) ) ;
10231023 nodes[ 1 ] . node . handle_update_add_htlc ( node_a_id, & send_event. msgs [ 0 ] ) ;
1024- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , send_event. commitment_msg, false ) ;
1024+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , & send_event. commitment_msg , false , false ) ;
10251025
10261026 expect_and_process_pending_htlcs ( & nodes[ 1 ] , false ) ;
10271027 check_added_monitors ! ( nodes[ 1 ] , 0 ) ;
@@ -1131,7 +1131,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
11311131 // Now deliver the new messages...
11321132
11331133 nodes[ 0 ] . node . handle_update_fail_htlc ( node_b_id, & messages_a. 0 ) ;
1134- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , messages_a. 1 , false ) ;
1134+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & messages_a. 1 , false , false ) ;
11351135 expect_payment_failed ! ( nodes[ 0 ] , payment_hash_1, true ) ;
11361136
11371137 nodes[ 2 ] . node . handle_update_add_htlc ( node_b_id, & send_event_b. msgs [ 0 ] ) ;
@@ -1244,7 +1244,7 @@ fn do_test_monitor_update_fail_raa(test_ignore_second_cs: bool) {
12441244 assert_eq ! ( send_event. node_id, node_a_id) ;
12451245 assert_eq ! ( send_event. msgs. len( ) , 1 ) ;
12461246 nodes[ 0 ] . node . handle_update_add_htlc ( node_b_id, & send_event. msgs [ 0 ] ) ;
1247- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , send_event. commitment_msg, false ) ;
1247+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & send_event. commitment_msg , false , false ) ;
12481248
12491249 expect_and_process_pending_htlcs ( & nodes[ 0 ] , false ) ;
12501250
@@ -1305,7 +1305,7 @@ fn test_monitor_update_fail_reestablish() {
13051305 expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
13061306 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
13071307 assert ! ( nodes[ 1 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
1308- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , updates. commitment_signed, false ) ;
1308+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 2 ] , & updates. commitment_signed , false , false ) ;
13091309
13101310 chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
13111311 let init_msg = msgs:: Init {
@@ -1364,7 +1364,7 @@ fn test_monitor_update_fail_reestablish() {
13641364 assert ! ( updates. update_fee. is_none( ) ) ;
13651365 assert_eq ! ( updates. update_fulfill_htlcs. len( ) , 1 ) ;
13661366 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, updates. update_fulfill_htlcs . remove ( 0 ) ) ;
1367- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , updates. commitment_signed, false ) ;
1367+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & updates. commitment_signed , false , false ) ;
13681368 expect_payment_sent ! ( nodes[ 0 ] , payment_preimage) ;
13691369}
13701370
@@ -1900,7 +1900,7 @@ fn test_monitor_update_fail_claim() {
19001900
19011901 let mut bs_fulfill = get_htlc_update_msgs ! ( nodes[ 1 ] , node_a_id) ;
19021902 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, bs_fulfill. update_fulfill_htlcs . remove ( 0 ) ) ;
1903- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , bs_fulfill. commitment_signed, false ) ;
1903+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & bs_fulfill. commitment_signed , false , false ) ;
19041904 expect_payment_sent ! ( nodes[ 0 ] , payment_preimage_1) ;
19051905
19061906 // Get the payment forwards, note that they were batched into one commitment update.
@@ -1909,7 +1909,8 @@ fn test_monitor_update_fail_claim() {
19091909 let bs_forward_update = get_htlc_update_msgs ! ( nodes[ 1 ] , node_a_id) ;
19101910 nodes[ 0 ] . node . handle_update_add_htlc ( node_b_id, & bs_forward_update. update_add_htlcs [ 0 ] ) ;
19111911 nodes[ 0 ] . node . handle_update_add_htlc ( node_b_id, & bs_forward_update. update_add_htlcs [ 1 ] ) ;
1912- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , bs_forward_update. commitment_signed, false ) ;
1912+ let commitment = & bs_forward_update. commitment_signed ;
1913+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , commitment, false , false ) ;
19131914 expect_and_process_pending_htlcs ( & nodes[ 0 ] , false ) ;
19141915
19151916 let events = nodes[ 0 ] . node . get_and_clear_pending_events ( ) ;
@@ -2011,7 +2012,7 @@ fn test_monitor_update_on_pending_forwards() {
20112012 assert_eq ! ( events. len( ) , 1 ) ;
20122013 let payment_event = SendEvent :: from_event ( events. pop ( ) . unwrap ( ) ) ;
20132014 nodes[ 1 ] . node . handle_update_add_htlc ( node_c_id, & payment_event. msgs [ 0 ] ) ;
2014- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , payment_event. commitment_msg, false ) ;
2015+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 2 ] , & payment_event. commitment_msg , false , false ) ;
20152016
20162017 chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
20172018 expect_and_process_pending_htlcs_and_htlc_handling_failed (
@@ -2105,7 +2106,7 @@ fn monitor_update_claim_fail_no_response() {
21052106
21062107 let mut bs_updates = get_htlc_update_msgs ! ( nodes[ 1 ] , node_a_id) ;
21072108 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, bs_updates. update_fulfill_htlcs . remove ( 0 ) ) ;
2108- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , bs_updates. commitment_signed, false ) ;
2109+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & bs_updates. commitment_signed , false , false ) ;
21092110 expect_payment_sent ! ( nodes[ 0 ] , payment_preimage_1) ;
21102111
21112112 claim_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , payment_preimage_2) ;
@@ -2633,7 +2634,8 @@ fn do_update_fee_resend_test(deliver_update: bool, parallel_updates: bool) {
26332634 nodes[ 1 ] . node . handle_revoke_and_ack ( node_a_id, & as_second_raa) ;
26342635 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
26352636 } else {
2636- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 0 ] , update_msgs. commitment_signed, false ) ;
2637+ let commitment = & update_msgs. commitment_signed ;
2638+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 0 ] , commitment, false , false ) ;
26372639 }
26382640
26392641 send_payment ( & nodes[ 0 ] , & [ & nodes[ 1 ] ] , 1000 ) ;
@@ -2947,12 +2949,8 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
29472949 ) ;
29482950 expect_payment_sent ( & nodes[ 0 ] , payment_preimage, None , false , false ) ;
29492951 if htlc_status == HTLCStatusAtDupClaim :: Cleared {
2950- commitment_signed_dance ! (
2951- nodes[ 0 ] ,
2952- nodes[ 1 ] ,
2953- & bs_updates. as_ref( ) . unwrap( ) . commitment_signed,
2954- false
2955- ) ;
2952+ let commitment = & bs_updates. as_ref ( ) . unwrap ( ) . commitment_signed ;
2953+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , commitment, false , false ) ;
29562954 expect_payment_path_successful ! ( nodes[ 0 ] ) ;
29572955 }
29582956 } else {
@@ -2990,12 +2988,8 @@ fn do_test_reconnect_dup_htlc_claims(htlc_status: HTLCStatusAtDupClaim, second_f
29902988 expect_payment_sent ( & nodes[ 0 ] , payment_preimage, None , false , false ) ;
29912989 }
29922990 if htlc_status != HTLCStatusAtDupClaim :: Cleared {
2993- commitment_signed_dance ! (
2994- nodes[ 0 ] ,
2995- nodes[ 1 ] ,
2996- & bs_updates. as_ref( ) . unwrap( ) . commitment_signed,
2997- false
2998- ) ;
2991+ let commitment = & bs_updates. as_ref ( ) . unwrap ( ) . commitment_signed ;
2992+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , commitment, false , false ) ;
29992993 expect_payment_path_successful ! ( nodes[ 0 ] ) ;
30002994 }
30012995}
@@ -3212,7 +3206,7 @@ fn double_temp_error() {
32123206 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, update_fulfill_2) ;
32133207 check_added_monitors ! ( nodes[ 0 ] , 0 ) ;
32143208 assert ! ( nodes[ 0 ] . node. get_and_clear_pending_msg_events( ) . is_empty( ) ) ;
3215- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , commitment_signed_b2, false ) ;
3209+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , & commitment_signed_b2, false , false ) ;
32163210 expect_payment_sent ! ( nodes[ 0 ] , payment_preimage_2) ;
32173211}
32183212
@@ -4139,7 +4133,8 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
41394133 let mut bs_updates = get_htlc_update_msgs ( & nodes[ 1 ] , & node_a_id) ;
41404134 let mut update_fulfill = bs_updates. update_fulfill_htlcs . remove ( 0 ) ;
41414135 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, update_fulfill) ;
4142- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , bs_updates. commitment_signed, false ) ;
4136+ let commitment = & bs_updates. commitment_signed ;
4137+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , commitment, false , false ) ;
41434138 expect_payment_sent ! ( & nodes[ 0 ] , payment_preimage) ;
41444139 }
41454140
@@ -4208,7 +4203,8 @@ fn do_test_glacial_peer_cant_hang(hold_chan_a: bool) {
42084203
42094204 let update_fulfill = a_update[ 0 ] . update_fulfill_htlcs [ 0 ] . clone ( ) ;
42104205 nodes[ 0 ] . node . handle_update_fulfill_htlc ( node_b_id, update_fulfill) ;
4211- commitment_signed_dance ! ( nodes[ 0 ] , nodes[ 1 ] , a_update[ 0 ] . commitment_signed, false ) ;
4206+ let commitment = & a_update[ 0 ] . commitment_signed ;
4207+ do_commitment_signed_dance ( & nodes[ 0 ] , & nodes[ 1 ] , commitment, false , false ) ;
42124208 expect_payment_sent ( & nodes[ 0 ] , payment_preimage, None , true , true ) ;
42134209 expect_payment_forwarded ! ( nodes[ 1 ] , nodes[ 0 ] , nodes[ 2 ] , Some ( 1000 ) , false , false ) ;
42144210
@@ -4519,7 +4515,7 @@ fn test_claim_to_closed_channel_blocks_forwarded_preimage_removal() {
45194515 chanmon_cfgs[ 1 ] . persister . set_update_ret ( ChannelMonitorUpdateStatus :: InProgress ) ;
45204516 nodes[ 1 ] . node . handle_update_fulfill_htlc ( node_c_id, updates. update_fulfill_htlcs . remove ( 0 ) ) ;
45214517 check_added_monitors ! ( nodes[ 1 ] , 1 ) ;
4522- commitment_signed_dance ! ( nodes[ 1 ] , nodes[ 2 ] , updates. commitment_signed, false ) ;
4518+ do_commitment_signed_dance ( & nodes[ 1 ] , & nodes[ 2 ] , & updates. commitment_signed , false , false ) ;
45234519
45244520 // At this point nodes[1] has the preimage and is waiting for the `ChannelMonitorUpdate` for
45254521 // channel A to hit disk. Until it does so, it shouldn't ever let the preimage dissapear from
0 commit comments