mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-18 22:54:25 +01:00
lightningd: don't explicitly tell connectd to disconnect, have it do it on sending error/warning.
Connectd already does this when we *receive* an error or warning, but now do it on send. This causes some slight behavior change: we don't disconnect when we close a channel, for example (our behaviour here has been inconsistent across versions, depending on the code). When connectd is told to disconnect, it now does so immediately, and doesn't wait for subds to drain etc. That simplifies the manual disconnect case, which now cleans up as it would from any other disconnection when connectd says it's disconnected. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
2962b93199
commit
a3c4908f4a
@@ -22,14 +22,10 @@
|
||||
void channel_set_owner(struct channel *channel, struct subd *owner)
|
||||
{
|
||||
struct subd *old_owner = channel->owner;
|
||||
bool was_connected = channel_is_connected(channel);
|
||||
channel->owner = owner;
|
||||
|
||||
if (old_owner) {
|
||||
if (old_owner)
|
||||
subd_release_channel(old_owner, channel);
|
||||
if (was_connected && !channel_is_connected(channel))
|
||||
maybe_disconnect_peer(channel->peer->ld, channel->peer);
|
||||
}
|
||||
}
|
||||
|
||||
struct htlc_out *channel_has_htlc_out(struct channel *channel)
|
||||
|
||||
Reference in New Issue
Block a user