@ -23,8 +23,7 @@ static bool connects_to_peer(struct subd *owner)
return owner & & owner - > talks_to_peer ;
}
void channel_set_owner ( struct channel * channel , struct subd * owner ,
bool reconnect )
void channel_set_owner ( struct channel * channel , struct subd * owner )
{
struct subd * old_owner = channel - > owner ;
channel - > owner = owner ;
@ -46,12 +45,6 @@ void channel_set_owner(struct channel *channel, struct subd *owner,
take ( msg ) ) ;
}
}
if ( reconnect ) {
/* Reconnect after 1 second: prevents some spurious
* reconnects during tests . */
delay_then_reconnect ( channel , 1 , & channel - > peer - > addr ) ;
}
}
channel - > connected = connects_to_peer ( owner ) ;
}
@ -105,7 +98,7 @@ static void destroy_channel(struct channel *channel)
htlc_state_name ( hin - > hstate ) ) ;
/* Free any old owner still hanging around. */
channel_set_owner ( channel , NULL , false ) ;
channel_set_owner ( channel , NULL ) ;
list_del_from ( & channel - > peer - > channels , & channel - > list ) ;
}
@ -379,7 +372,7 @@ void channel_fail_permanent(struct channel *channel, const char *fmt, ...)
channel - > error = towire_errorfmt ( channel , & cid , " %s " , why ) ;
}
channel_set_owner ( channel , NULL , false ) ;
channel_set_owner ( channel , NULL ) ;
/* Drop non-cooperatively (unilateral) to chain. */
drop_to_chain ( ld , channel , false ) ;
@ -446,5 +439,9 @@ void channel_fail_transient(struct channel *channel, const char *fmt, ...)
}
# endif
channel_set_owner ( channel , NULL , true ) ;
channel_set_owner ( channel , NULL ) ;
/* Reconnect after 1 second: prevents some spurious reconnects
* during tests . */
delay_then_reconnect ( channel , 1 , & channel - > peer - > addr ) ;
}