mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
connectd: clean up the channel stuffs when we get a reconnect
If they've disconnected/reconnected we need to terminate all the inflight stuff, plus go ahead and call 'disconnect' plugin trigger etc.
This commit is contained in:
parent
97e64915c5
commit
8cc2919884
@ -283,8 +283,10 @@ static void peer_please_disconnect(struct lightningd *ld, const u8 *msg)
|
||||
c = active_channel_by_id(ld, &id, &uc);
|
||||
if (uc)
|
||||
kill_uncommitted_channel(uc, "Reconnected");
|
||||
else if (c)
|
||||
else if (c) {
|
||||
channel_cleanup_commands(c, "Reconnected");
|
||||
channel_fail_reconnect(c, "Reconnected");
|
||||
}
|
||||
#if EXPERIMENTAL_FEATURES
|
||||
else {
|
||||
/* v2 has unsaved channels, not uncommitted_chans */
|
||||
|
@ -82,11 +82,12 @@ void channel_close_conn(struct channel *channel, const char *why)
|
||||
channel_disconnect(channel, LOG_INFORM, false, why);
|
||||
}
|
||||
|
||||
static void channel_close_reconn(struct channel *channel, const char *why)
|
||||
void channel_close_reconn(struct channel *channel, const char *why)
|
||||
{
|
||||
/* Close dualopend */
|
||||
/* Close the daemon */
|
||||
if (channel->owner) {
|
||||
log_info(channel->log, "Killing dualopend: %s", why);
|
||||
log_info(channel->log, "Killing %s: %s",
|
||||
channel->owner->name, why);
|
||||
|
||||
subd_release_channel(channel->owner, channel);
|
||||
channel->owner = NULL;
|
||||
|
@ -23,6 +23,9 @@ void dualopen_tell_depth(struct subd *dualopend,
|
||||
void channel_close_conn(struct channel *channel,
|
||||
const char *why);
|
||||
|
||||
void channel_close_reconn(struct channel *channel,
|
||||
const char *why);
|
||||
|
||||
void json_add_unsaved_channel(struct json_stream *response,
|
||||
const struct channel *channel);
|
||||
#endif /* LIGHTNING_LIGHTNINGD_DUAL_OPEN_CONTROL_H */
|
||||
|
Loading…
Reference in New Issue
Block a user