@@ -4862,6 +4862,15 @@ macro_rules! handle_chan_reestablish_msgs {
48624862			} 
48634863		} 
48644864
4865+ 		let  mut  tx_signatures = None ; 
4866+ 		if  let  Some ( & MessageSendEvent :: SendTxSignatures  {  ref node_id,  ref msg } )  =
4867+ 			msg_events. get( idx) 
4868+ 		{ 
4869+ 			assert_eq!( * node_id,  $dst_node. node. get_our_node_id( ) ) ; 
4870+ 			tx_signatures = Some ( msg. clone( ) ) ; 
4871+ 			idx += 1 ; 
4872+ 		} 
4873+ 
48654874		if  let  Some ( & MessageSendEvent :: SendAnnouncementSignatures  {  ref node_id,  ref msg } )  =
48664875			msg_events. get( idx) 
48674876		{ 
@@ -4880,7 +4889,7 @@ macro_rules! handle_chan_reestablish_msgs {
48804889
48814890		assert_eq!( msg_events. len( ) ,  idx,  "{msg_events:?}" ) ; 
48824891
4883- 		( channel_ready,  revoke_and_ack,  commitment_update,  order,  announcement_sigs) 
4892+ 		( channel_ready,  revoke_and_ack,  commitment_update,  order,  announcement_sigs,  tx_signatures ) 
48844893	} } ; 
48854894} 
48864895
@@ -4889,6 +4898,9 @@ pub struct ReconnectArgs<'a, 'b, 'c, 'd> {
48894898	pub  node_b :  & ' a  Node < ' b ,  ' c ,  ' d > , 
48904899	pub  send_channel_ready :  ( bool ,  bool ) , 
48914900	pub  send_announcement_sigs :  ( bool ,  bool ) , 
4901+ 	pub  send_interactive_tx_commit_sig :  ( bool ,  bool ) , 
4902+ 	pub  send_interactive_tx_sigs :  ( bool ,  bool ) , 
4903+ 	pub  expect_renegotiated_funding_locked_monitor_update :  ( bool ,  bool ) , 
48924904	pub  pending_responding_commitment_signed :  ( bool ,  bool ) , 
48934905	/// Indicates that the pending responding commitment signed will be a dup for the recipient, 
48944906/// and no monitor update is expected 
@@ -4908,6 +4920,9 @@ impl<'a, 'b, 'c, 'd> ReconnectArgs<'a, 'b, 'c, 'd> {
49084920			node_b, 
49094921			send_channel_ready :  ( false ,  false ) , 
49104922			send_announcement_sigs :  ( false ,  false ) , 
4923+ 			send_interactive_tx_commit_sig :  ( false ,  false ) , 
4924+ 			send_interactive_tx_sigs :  ( false ,  false ) , 
4925+ 			expect_renegotiated_funding_locked_monitor_update :  ( false ,  false ) , 
49114926			pending_responding_commitment_signed :  ( false ,  false ) , 
49124927			pending_responding_commitment_signed_dup_monitor :  ( false ,  false ) , 
49134928			pending_htlc_adds :  ( 0 ,  0 ) , 
@@ -4928,6 +4943,9 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49284943		node_b, 
49294944		send_channel_ready, 
49304945		send_announcement_sigs, 
4946+ 		send_interactive_tx_commit_sig, 
4947+ 		send_interactive_tx_sigs, 
4948+ 		expect_renegotiated_funding_locked_monitor_update, 
49314949		pending_htlc_adds, 
49324950		pending_htlc_claims, 
49334951		pending_htlc_fails, 
@@ -4978,7 +4996,11 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49784996		node_b. node . handle_channel_reestablish ( node_a_id,  & msg) ; 
49794997		resp_1. push ( handle_chan_reestablish_msgs ! ( node_b,  node_a) ) ; 
49804998	} 
4981- 	if  pending_cell_htlc_claims. 0  != 0  || pending_cell_htlc_fails. 0  != 0  { 
4999+ 
5000+ 	if  pending_cell_htlc_claims. 0  != 0 
5001+ 		|| pending_cell_htlc_fails. 0  != 0 
5002+ 		|| expect_renegotiated_funding_locked_monitor_update. 1 
5003+ 	{ 
49825004		check_added_monitors ! ( node_b,  1 ) ; 
49835005	}  else  { 
49845006		check_added_monitors ! ( node_b,  0 ) ; 
@@ -4989,7 +5011,10 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
49895011		node_a. node . handle_channel_reestablish ( node_b_id,  & msg) ; 
49905012		resp_2. push ( handle_chan_reestablish_msgs ! ( node_a,  node_b) ) ; 
49915013	} 
4992- 	if  pending_cell_htlc_claims. 1  != 0  || pending_cell_htlc_fails. 1  != 0  { 
5014+ 	if  pending_cell_htlc_claims. 1  != 0 
5015+ 		|| pending_cell_htlc_fails. 1  != 0 
5016+ 		|| expect_renegotiated_funding_locked_monitor_update. 0 
5017+ 	{ 
49935018		check_added_monitors ! ( node_a,  1 ) ; 
49945019	}  else  { 
49955020		check_added_monitors ! ( node_a,  0 ) ; 
@@ -5036,6 +5061,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
50365061		}  else  { 
50375062			assert ! ( chan_msgs. 4 . is_none( ) ) ; 
50385063		} 
5064+ 		if  send_interactive_tx_commit_sig. 0  { 
5065+ 			assert ! ( chan_msgs. 1 . is_none( ) ) ; 
5066+ 			let  commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ; 
5067+ 			assert_eq ! ( commitment_update. commitment_signed. len( ) ,  1 ) ; 
5068+ 			node_a. node . handle_commitment_signed_batch_test ( 
5069+ 				node_b_id, 
5070+ 				& commitment_update. commitment_signed , 
5071+ 			) 
5072+ 		} 
5073+ 		if  send_interactive_tx_sigs. 0  { 
5074+ 			let  tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ; 
5075+ 			node_a. node . handle_tx_signatures ( node_b_id,  & tx_signatures) ; 
5076+ 		}  else  { 
5077+ 			assert ! ( chan_msgs. 5 . is_none( ) ) ; 
5078+ 		} 
50395079		if  pending_raa. 0  { 
50405080			assert ! ( chan_msgs. 3  == RAACommitmentOrder :: RevokeAndACKFirst ) ; 
50415081			node_a. node . handle_revoke_and_ack ( node_b_id,  & chan_msgs. 1 . unwrap ( ) ) ; 
@@ -5127,6 +5167,21 @@ pub fn reconnect_nodes<'a, 'b, 'c, 'd>(args: ReconnectArgs<'a, 'b, 'c, 'd>) {
51275167		}  else  { 
51285168			assert ! ( chan_msgs. 4 . is_none( ) ) ; 
51295169		} 
5170+ 		if  send_interactive_tx_commit_sig. 1  { 
5171+ 			assert ! ( chan_msgs. 1 . is_none( ) ) ; 
5172+ 			let  commitment_update = chan_msgs. 2 . take ( ) . unwrap ( ) ; 
5173+ 			assert_eq ! ( commitment_update. commitment_signed. len( ) ,  1 ) ; 
5174+ 			node_b. node . handle_commitment_signed_batch_test ( 
5175+ 				node_a_id, 
5176+ 				& commitment_update. commitment_signed , 
5177+ 			) 
5178+ 		} 
5179+ 		if  send_interactive_tx_sigs. 1  { 
5180+ 			let  tx_signatures = chan_msgs. 5 . take ( ) . unwrap ( ) ; 
5181+ 			node_b. node . handle_tx_signatures ( node_a_id,  & tx_signatures) ; 
5182+ 		}  else  { 
5183+ 			assert ! ( chan_msgs. 5 . is_none( ) ) ; 
5184+ 		} 
51305185		if  pending_raa. 1  { 
51315186			assert ! ( chan_msgs. 3  == RAACommitmentOrder :: RevokeAndACKFirst ) ; 
51325187			node_b. node . handle_revoke_and_ack ( node_a_id,  & chan_msgs. 1 . unwrap ( ) ) ; 
0 commit comments