mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
df: rework closing logic
Trying to put all the disconnect logic into the same path was a dumb idea. If you asked to reconnect but passed in an 'unsaved' channel, we would not call the 'reconnect' code. Instead, we make a differentiation between "unsaved" channels (ones that we haven't received commitment tx for) and handle the disconnect for these separate from where we want to do a reconnect.
This commit is contained in:
@@ -297,11 +297,9 @@ static void peer_please_disconnect(struct lightningd *ld, const u8 *msg)
|
||||
channel_cleanup_commands(c, "Reconnected");
|
||||
channel_fail_reconnect(c, "Reconnected");
|
||||
}
|
||||
else {
|
||||
/* v2 has unsaved channels, not uncommitted_chans */
|
||||
c = unsaved_channel_by_id(ld, &id);
|
||||
if (c)
|
||||
channel_close_conn(c, "Reconnected");
|
||||
else if ((c = unsaved_channel_by_id(ld, &id))) {
|
||||
log_info(c->log, "Killing opening daemon: Reconnected");
|
||||
channel_unsaved_close_conn(c, "Reconnected");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user