connectd: cleanup gossip connection properly

This still has a problem, but we can't fix that easily here; per-peer
daemons don't have this trouble, however.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-07-24 15:48:58 +09:30
parent eab83ca79b
commit 5a8091c853
1 changed files with 2 additions and 0 deletions

View File

@ -632,6 +632,8 @@ static struct io_plan *ready_for_master(struct io_conn *conn, struct peer *peer)
peer->gfeatures,
peer->lfeatures);
/* FIXME: This can leave half-read/written gossip messages! */
io_close_taken_fd(peer->local->gossip_conn.conn);
send_peer_with_fds(peer, take(msg));
/* In case we set this earlier. */
tal_del_destructor(peer, fail_release);