@@ -4987,8 +4987,7 @@ static u8 *to_bytearr(const tal_t *ctx,
49874987}
49884988
49894989static void peer_reconnect (struct peer * peer ,
4990- const struct secret * last_remote_per_commit_secret ,
4991- bool reestablish_only )
4990+ const struct secret * last_remote_per_commit_secret )
49924991{
49934992 struct channel_id channel_id ;
49944993 /* Note: BOLT #2 uses these names! */
@@ -5146,14 +5145,6 @@ static void peer_reconnect(struct peer *peer,
51465145 do {
51475146 clean_tmpctx ();
51485147 msg = peer_read (tmpctx , peer -> pps );
5149-
5150- /* connectd promised us the msg was reestablish? */
5151- if (reestablish_only ) {
5152- if (fromwire_peektype (msg ) != WIRE_CHANNEL_REESTABLISH )
5153- status_failed (STATUS_FAIL_INTERNAL_ERROR ,
5154- "Expected reestablish, got: %s" ,
5155- tal_hex (tmpctx , msg ));
5156- }
51575148 } while (handle_peer_error_or_warning (peer -> pps , msg ) ||
51585149 capture_premature_msg (& premature_msgs , msg ));
51595150
@@ -5501,23 +5492,6 @@ static void peer_reconnect(struct peer *peer,
55015492 set_channel_type (peer -> channel , type );
55025493 }
55035494
5504- /* Now stop, we've been polite long enough. */
5505- if (reestablish_only ) {
5506- /* We've reestablished! */
5507- wire_sync_write (MASTER_FD ,
5508- take (towire_channeld_reestablished (NULL )));
5509-
5510- /* If we were successfully closing, we still go to closingd. */
5511- if (shutdown_complete (peer )) {
5512- send_shutdown_complete (peer );
5513- daemon_shutdown ();
5514- exit (0 );
5515- }
5516- peer_failed_err (peer -> pps ,
5517- & peer -> channel_id ,
5518- "Channel is already closed" );
5519- }
5520-
55215495 tal_free (send_tlvs );
55225496
55235497 /* We've reestablished! */
@@ -6103,7 +6077,6 @@ static void init_channel(struct peer *peer)
61036077 u32 minimum_depth , lease_expiry ;
61046078 struct secret last_remote_per_commit_secret ;
61056079 struct penalty_base * pbases ;
6106- bool reestablish_only ;
61076080 struct channel_type * channel_type ;
61086081
61096082 assert (!(fcntl (MASTER_FD , F_GETFL ) & O_NONBLOCK ));
@@ -6159,7 +6132,6 @@ static void init_channel(struct peer *peer)
61596132 & channel_type ,
61606133 & peer -> dev_disable_commit ,
61616134 & pbases ,
6162- & reestablish_only ,
61636135 & peer -> experimental_upgrade ,
61646136 & peer -> splice_state -> inflights ,
61656137 & peer -> local_alias )) {
@@ -6249,10 +6221,7 @@ static void init_channel(struct peer *peer)
62496221
62506222 /* OK, now we can process peer messages. */
62516223 if (reconnected )
6252- peer_reconnect (peer , & last_remote_per_commit_secret ,
6253- reestablish_only );
6254- else
6255- assert (!reestablish_only );
6224+ peer_reconnect (peer , & last_remote_per_commit_secret );
62566225
62576226 /* If we have a messages to send, send them immediately */
62586227 if (fwd_msg )
0 commit comments