From f2e0c359162147b0b1716d3d02c521b93009bbeb Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Tue, 24 Jul 2018 15:48:59 +0930 Subject: [PATCH] connectd: hack in a gossip flush as a workaround. We were failing test_closing_torture, with gossipd complaining that it received a malformed packet. This makes it pass, but the real fix is in the next series. Signed-off-by: Rusty Russell --- connectd/connect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/connectd/connect.c b/connectd/connect.c index 138b73fc0..036b5bfdc 100644 --- a/connectd/connect.c +++ b/connectd/connect.c @@ -626,7 +626,10 @@ 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! */ + /* FIXME: This can block (bad!) and anyway we can still have + * half-*read* gossip messages! */ + daemon_conn_sync_flush(&peer->local->gossip_conn); + io_close_taken_fd(peer->local->gossip_conn.conn); send_peer_with_fds(peer, take(msg)); /* In case we set this earlier. */