@@ -4807,6 +4807,15 @@ macro_rules! handle_chan_reestablish_msgs {
48074807 }
48084808 }
48094809
4810+ let mut tx_signatures = None ;
4811+ if let Some ( & MessageSendEvent :: SendTxSignatures { ref node_id, ref msg } ) =
4812+ msg_events. get( idx)
4813+ {
4814+ assert_eq!( * node_id, $dst_node. node. get_our_node_id( ) ) ;
4815+ tx_signatures = Some ( msg. clone( ) ) ;
4816+ idx += 1 ;
4817+ }
4818+
48104819 if let Some ( & MessageSendEvent :: SendChannelUpdate { ref node_id, .. } ) = msg_events. get( idx)
48114820 {
48124821 assert_eq!( * node_id, $dst_node. node. get_our_node_id( ) ) ;
@@ -4825,7 +4834,7 @@ macro_rules! handle_chan_reestablish_msgs {
48254834
48264835 assert_eq!( msg_events. len( ) , idx, "{msg_events:?}" ) ;
48274836
4828- ( channel_ready, revoke_and_ack, commitment_update, order, announcement_sigs)
4837+ ( channel_ready, revoke_and_ack, commitment_update, order, announcement_sigs, tx_signatures )
48294838 } } ;
48304839}
48314840
@@ -4834,6 +4843,9 @@ pub struct ReconnectArgs<'a, 'b, 'c, 'd> {
48344843 pub node_b : & ' a Node < ' b , ' c , ' d > ,
48354844 pub send_channel_ready : ( bool , bool ) ,
48364845 pub send_announcement_sigs : ( bool , bool ) ,
4846+ pub send_interactive_tx_commit_sig : ( bool , bool ) ,
4847+ pub send_interactive_tx_sigs : ( bool , bool ) ,
4848+ pub expect_renegotiated_funding_locked_monitor_update : ( bool , bool ) ,
48374849 pub pending_responding_commitment_signed : ( bool , bool ) ,
48384850 /// Indicates that the pending responding commitment signed will be a dup for the recipient,
48394851 /// and no monitor update is expected
@@ -4853,6 +4865,9 @@ impl<'a, 'b, 'c, 'd> ReconnectArgs<'a, 'b, 'c, 'd> {
48534865 node_b,
48544866 send_channel_ready : ( false , false ) ,
48554867 send_announcement_sigs : ( false , false ) ,
4868+ send_interactive_tx_commit_sig : ( false , false ) ,
4869+ send_interactive_tx_sigs : ( false , false ) ,
4870+ expect_renegotiated_funding_locked_monitor_update : ( false , false ) ,
48564871 pending_responding_commitment_signed : ( false , false ) ,
48574872 pending_responding_commitment_signed_dup_monitor : ( false , false ) ,
48584873 pending_htlc_adds : ( 0 , 0 ) ,
@@ -4873,6 +4888,9 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
48734888 node_b,
48744889 send_channel_ready,
48754890 send_announcement_sigs,
4891+ send_interactive_tx_commit_sig,
4892+ send_interactive_tx_sigs,
4893+ expect_renegotiated_funding_locked_monitor_update,
48764894 pending_htlc_adds,
48774895 pending_htlc_claims,
48784896 pending_htlc_fails,
@@ -4923,7 +4941,11 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49234941 node_b. node . handle_channel_reestablish ( node_a_id, & msg) ;
49244942 resp_1. push ( handle_chan_reestablish_msgs ! ( node_b, node_a) ) ;
49254943 }
4926- if pending_cell_htlc_claims. 0 != 0 || pending_cell_htlc_fails. 0 != 0 {
4944+
4945+ if pending_cell_htlc_claims. 0 != 0
4946+ || pending_cell_htlc_fails. 0 != 0
4947+ || expect_renegotiated_funding_locked_monitor_update. 1
4948+ {
49274949 check_added_monitors ! ( node_b, 1 ) ;
49284950 } else {
49294951 check_added_monitors ! ( node_b, 0 ) ;
@@ -4934,7 +4956,10 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49344956 node_a. node . handle_channel_reestablish ( node_b_id, & msg) ;
49354957 resp_2. push ( handle_chan_reestablish_msgs ! ( node_a, node_b) ) ;
49364958 }
4937- if pending_cell_htlc_claims. 1 != 0 || pending_cell_htlc_fails. 1 != 0 {
4959+ if pending_cell_htlc_claims. 1 != 0
4960+ || pending_cell_htlc_fails. 1 != 0
4961+ || expect_renegotiated_funding_locked_monitor_update. 0
4962+ {
49384963 check_added_monitors ! ( node_a, 1 ) ;
49394964 } else {
49404965 check_added_monitors ! ( node_a, 0 ) ;
@@ -4981,6 +5006,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49815006 } else {
49825007 assert ! ( chan_msgs. 4 . is_none( ) ) ;
49835008 }
5009+ if send_interactive_tx_commit_sig. 0 {
5010+ assert ! ( chan_msgs. 1 . is_none( ) ) ;
5011+ let commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ;
5012+ assert_eq ! ( commitment_update. commitment_signed. len( ) , 1 ) ;
5013+ node_a. node . handle_commitment_signed_batch_test (
5014+ node_b_id,
5015+ & commitment_update. commitment_signed ,
5016+ )
5017+ }
5018+ if send_interactive_tx_sigs. 0 {
5019+ let tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ;
5020+ node_a. node . handle_tx_signatures ( node_b_id, & tx_signatures) ;
5021+ } else {
5022+ assert ! ( chan_msgs. 5 . is_none( ) ) ;
5023+ }
49845024 if pending_raa. 0 {
49855025 assert ! ( chan_msgs. 3 == RAACommitmentOrder :: RevokeAndACKFirst ) ;
49865026 node_a. node . handle_revoke_and_ack ( node_b_id, & chan_msgs. 1 . unwrap ( ) ) ;
@@ -5072,6 +5112,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
50725112 } else {
50735113 assert ! ( chan_msgs. 4 . is_none( ) ) ;
50745114 }
5115+ if send_interactive_tx_commit_sig. 1 {
5116+ assert ! ( chan_msgs. 1 . is_none( ) ) ;
5117+ let commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ;
5118+ assert_eq ! ( commitment_update. commitment_signed. len( ) , 1 ) ;
5119+ node_b. node . handle_commitment_signed_batch_test (
5120+ node_a_id,
5121+ & commitment_update. commitment_signed ,
5122+ )
5123+ }
5124+ if send_interactive_tx_sigs. 1 {
5125+ let tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ;
5126+ node_b. node . handle_tx_signatures ( node_a_id, & tx_signatures) ;
5127+ } else {
5128+ assert ! ( chan_msgs. 5 . is_none( ) ) ;
5129+ }
50755130 if pending_raa. 1 {
50765131 assert ! ( chan_msgs. 3 == RAACommitmentOrder :: RevokeAndACKFirst ) ;
50775132 node_b. node . handle_revoke_and_ack ( node_a_id, & chan_msgs. 1 . unwrap ( ) ) ;
0 commit comments