Browse Source

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>
ppa-0.6.1
Rusty Russell 8 years ago
parent
commit
1b0dc7414c
  1. 4
      lightningd/connection.c
  2. 2
      lightningd/gossip/gossip.c

4
lightningd/connection.c

@ -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);
}

2
lightningd/gossip/gossip.c

@ -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…
Cancel
Save