mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
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:
parent
38b68d478f
commit
1b0dc7414c
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user