mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
gossipd: make sure that freeing peer closes connection to it.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
88da956531
commit
0e6aec081a
@ -154,6 +154,10 @@ static void destroy_peer(struct peer *peer)
|
||||
node = get_node(peer->daemon->rstate, &peer->id);
|
||||
if (node)
|
||||
peer_disable_channels(peer->daemon, node);
|
||||
|
||||
/* In case we've been manually freed, close conn (our parent: if
|
||||
* it is freed, this will be a noop). */
|
||||
io_close(peer->remote->conn);
|
||||
}
|
||||
|
||||
static struct peer *find_peer(struct daemon *daemon, const struct pubkey *id)
|
||||
|
Loading…
Reference in New Issue
Block a user