mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
lightningd/channel.c: Transfer peer to connectd only if connectd alive.
Fixes: #2677
This commit is contained in:
parent
37440e9447
commit
3466261b20
@ -32,9 +32,19 @@ void channel_set_owner(struct channel *channel, struct subd *owner,
|
||||
if (old_owner) {
|
||||
subd_release_channel(old_owner, channel);
|
||||
if (channel->connected && !connects_to_peer(owner)) {
|
||||
u8 *msg = towire_connectctl_peer_disconnected(NULL,
|
||||
&channel->peer->id);
|
||||
subd_send_msg(channel->peer->ld->connectd, take(msg));
|
||||
/* If shutting down, connectd no longer exists,
|
||||
* and we should not transfer peer to connectd.
|
||||
* Only transfer to connectd if connectd is
|
||||
* there to be transferred to.
|
||||
*/
|
||||
if (channel->peer->ld->connectd) {
|
||||
u8 *msg;
|
||||
msg = towire_connectctl_peer_disconnected(
|
||||
NULL,
|
||||
&channel->peer->id);
|
||||
subd_send_msg(channel->peer->ld->connectd,
|
||||
take(msg));
|
||||
}
|
||||
}
|
||||
|
||||
if (reconnect) {
|
||||
|
Loading…
Reference in New Issue
Block a user