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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-07-24 15:48:59 +09:30
parent 722dd05e9d
commit f2e0c35916

View File

@ -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. */