@@ -4837,6 +4837,15 @@ macro_rules! handle_chan_reestablish_msgs {
48374837 }
48384838 }
48394839
4840+ let mut tx_signatures = None ;
4841+ if let Some ( & MessageSendEvent :: SendTxSignatures { ref node_id, ref msg } ) =
4842+ msg_events. get( idx)
4843+ {
4844+ assert_eq!( * node_id, $dst_node. node. get_our_node_id( ) ) ;
4845+ tx_signatures = Some ( msg. clone( ) ) ;
4846+ idx += 1 ;
4847+ }
4848+
48404849 if let Some ( & MessageSendEvent :: SendChannelUpdate { ref node_id, .. } ) = msg_events. get( idx)
48414850 {
48424851 assert_eq!( * node_id, $dst_node. node. get_our_node_id( ) ) ;
@@ -4855,7 +4864,7 @@ macro_rules! handle_chan_reestablish_msgs {
48554864
48564865 assert_eq!( msg_events. len( ) , idx, "{msg_events:?}" ) ;
48574866
4858- ( channel_ready, revoke_and_ack, commitment_update, order, announcement_sigs)
4867+ ( channel_ready, revoke_and_ack, commitment_update, order, announcement_sigs, tx_signatures )
48594868 } } ;
48604869}
48614870
@@ -4864,6 +4873,9 @@ pub struct ReconnectArgs<'a, 'b, 'c, 'd> {
48644873 pub node_b : & ' a Node < ' b , ' c , ' d > ,
48654874 pub send_channel_ready : ( bool , bool ) ,
48664875 pub send_announcement_sigs : ( bool , bool ) ,
4876+ pub send_interactive_tx_commit_sig : ( bool , bool ) ,
4877+ pub send_interactive_tx_sigs : ( bool , bool ) ,
4878+ pub expect_renegotiated_funding_locked_monitor_update : ( bool , bool ) ,
48674879 pub pending_responding_commitment_signed : ( bool , bool ) ,
48684880 /// Indicates that the pending responding commitment signed will be a dup for the recipient,
48694881 /// and no monitor update is expected
@@ -4883,6 +4895,9 @@ impl<'a, 'b, 'c, 'd> ReconnectArgs<'a, 'b, 'c, 'd> {
48834895 node_b,
48844896 send_channel_ready : ( false , false ) ,
48854897 send_announcement_sigs : ( false , false ) ,
4898+ send_interactive_tx_commit_sig : ( false , false ) ,
4899+ send_interactive_tx_sigs : ( false , false ) ,
4900+ expect_renegotiated_funding_locked_monitor_update : ( false , false ) ,
48864901 pending_responding_commitment_signed : ( false , false ) ,
48874902 pending_responding_commitment_signed_dup_monitor : ( false , false ) ,
48884903 pending_htlc_adds : ( 0 , 0 ) ,
@@ -4903,6 +4918,9 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49034918 node_b,
49044919 send_channel_ready,
49054920 send_announcement_sigs,
4921+ send_interactive_tx_commit_sig,
4922+ send_interactive_tx_sigs,
4923+ expect_renegotiated_funding_locked_monitor_update,
49064924 pending_htlc_adds,
49074925 pending_htlc_claims,
49084926 pending_htlc_fails,
@@ -4953,7 +4971,11 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49534971 node_b. node . handle_channel_reestablish ( node_a_id, & msg) ;
49544972 resp_1. push ( handle_chan_reestablish_msgs ! ( node_b, node_a) ) ;
49554973 }
4956- if pending_cell_htlc_claims. 0 != 0 || pending_cell_htlc_fails. 0 != 0 {
4974+
4975+ if pending_cell_htlc_claims. 0 != 0
4976+ || pending_cell_htlc_fails. 0 != 0
4977+ || expect_renegotiated_funding_locked_monitor_update. 1
4978+ {
49574979 check_added_monitors ! ( node_b, 1 ) ;
49584980 } else {
49594981 check_added_monitors ! ( node_b, 0 ) ;
@@ -4964,7 +4986,10 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49644986 node_a. node . handle_channel_reestablish ( node_b_id, & msg) ;
49654987 resp_2. push ( handle_chan_reestablish_msgs ! ( node_a, node_b) ) ;
49664988 }
4967- if pending_cell_htlc_claims. 1 != 0 || pending_cell_htlc_fails. 1 != 0 {
4989+ if pending_cell_htlc_claims. 1 != 0
4990+ || pending_cell_htlc_fails. 1 != 0
4991+ || expect_renegotiated_funding_locked_monitor_update. 0
4992+ {
49684993 check_added_monitors ! ( node_a, 1 ) ;
49694994 } else {
49704995 check_added_monitors ! ( node_a, 0 ) ;
@@ -5011,6 +5036,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
50115036 } else {
50125037 assert ! ( chan_msgs. 4 . is_none( ) ) ;
50135038 }
5039+ if send_interactive_tx_commit_sig. 0 {
5040+ assert ! ( chan_msgs. 1 . is_none( ) ) ;
5041+ let commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ;
5042+ assert_eq ! ( commitment_update. commitment_signed. len( ) , 1 ) ;
5043+ node_a. node . handle_commitment_signed_batch_test (
5044+ node_b_id,
5045+ & commitment_update. commitment_signed ,
5046+ )
5047+ }
5048+ if send_interactive_tx_sigs. 0 {
5049+ let tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ;
5050+ node_a. node . handle_tx_signatures ( node_b_id, & tx_signatures) ;
5051+ } else {
5052+ assert ! ( chan_msgs. 5 . is_none( ) ) ;
5053+ }
50145054 if pending_raa. 0 {
50155055 assert ! ( chan_msgs. 3 == RAACommitmentOrder :: RevokeAndACKFirst ) ;
50165056 node_a. node . handle_revoke_and_ack ( node_b_id, & chan_msgs. 1 . unwrap ( ) ) ;
@@ -5102,6 +5142,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
51025142 } else {
51035143 assert ! ( chan_msgs. 4 . is_none( ) ) ;
51045144 }
5145+ if send_interactive_tx_commit_sig. 1 {
5146+ assert ! ( chan_msgs. 1 . is_none( ) ) ;
5147+ let commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ;
5148+ assert_eq ! ( commitment_update. commitment_signed. len( ) , 1 ) ;
5149+ node_b. node . handle_commitment_signed_batch_test (
5150+ node_a_id,
5151+ & commitment_update. commitment_signed ,
5152+ )
5153+ }
5154+ if send_interactive_tx_sigs. 1 {
5155+ let tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ;
5156+ node_b. node . handle_tx_signatures ( node_a_id, & tx_signatures) ;
5157+ } else {
5158+ assert ! ( chan_msgs. 5 . is_none( ) ) ;
5159+ }
51055160 if pending_raa. 1 {
51065161 assert ! ( chan_msgs. 3 == RAACommitmentOrder :: RevokeAndACKFirst ) ;
51075162 node_b. node . handle_revoke_and_ack ( node_a_id, & chan_msgs. 1 . unwrap ( ) ) ;
0 commit comments