lightningd/connection: use msg_queue_wait so it can wake us.

This measn that gossip (which also wants to wake it) needs to wake
the queue, not the daemon_conn.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2017-03-18 05:16:52 +10:30
parent 38b68d478f
commit 1b0dc7414c
2 changed files with 3 additions and 3 deletions

View File

@ -20,7 +20,8 @@ struct io_plan *daemon_conn_write_next(struct io_conn *conn,
} else if (dc->msg_queue_cleared_cb) {
return dc->msg_queue_cleared_cb(conn, dc);
} else {
return io_out_wait(conn, dc, daemon_conn_write_next, dc);
return msg_queue_wait(conn, &dc->out,
daemon_conn_write_next, dc);
}
}
@ -49,5 +50,4 @@ void daemon_conn_init(tal_t *ctx, struct daemon_conn *dc, int fd,
void daemon_conn_send(struct daemon_conn *dc, const u8 *msg)
{
msg_enqueue(&dc->out, msg);
io_wake(dc);
}

View File

@ -198,7 +198,7 @@ static void wake_pkt_out(struct peer *peer)
/* Notify the peer-write loop */
io_wake(peer);
/* Notify the daemon_conn-write loop */
io_wake(&peer->owner_conn);
io_wake(&peer->owner_conn.out);
}
/* Loop through the backlog of channel_{announcements,updates} and