mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 09:54:16 +01:00
common/daemon_conn: add daemon_conn_wake() helper.
We've been open-coding it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
16b8f1eb83
commit
f747ad8f73
@ -104,3 +104,8 @@ void daemon_conn_send_fd(struct daemon_conn *dc, int fd)
|
||||
{
|
||||
msg_enqueue_fd(&dc->out, fd);
|
||||
}
|
||||
|
||||
void daemon_conn_wake(struct daemon_conn *dc)
|
||||
{
|
||||
msg_wake(&dc->out);
|
||||
}
|
||||
|
@ -57,6 +57,11 @@ void daemon_conn_clear(struct daemon_conn *dc);
|
||||
*/
|
||||
void daemon_conn_send(struct daemon_conn *dc, const u8 *msg);
|
||||
|
||||
/**
|
||||
* daemon_conn_wake - Wake queue (fires msg_queue_cleared_cb if queue empty)
|
||||
*/
|
||||
void daemon_conn_wake(struct daemon_conn *dc);
|
||||
|
||||
/**
|
||||
* daemon_conn_send_fd - Enqueue a file descriptor to be sent (closed after)
|
||||
*/
|
||||
|
@ -569,7 +569,7 @@ static void wake_gossip_out(struct peer *peer)
|
||||
msg_wake(&peer->local->peer_out);
|
||||
else if (peer->remote)
|
||||
/* Notify the daemon_conn-write loop */
|
||||
msg_wake(&peer->remote->out);
|
||||
daemon_conn_wake(peer->remote);
|
||||
}
|
||||
|
||||
static void peer_error(struct peer *peer, const char *fmt, ...)
|
||||
@ -944,7 +944,7 @@ static void handle_query_short_channel_ids(struct peer *peer, u8 *msg)
|
||||
msg_wake(&peer->local->peer_out);
|
||||
else
|
||||
/* Notify the daemon_conn-write loop */
|
||||
msg_wake(&peer->remote->out);
|
||||
daemon_conn_wake(peer->remote);
|
||||
}
|
||||
|
||||
static void handle_gossip_timestamp_filter(struct peer *peer, u8 *msg)
|
||||
|
Loading…
Reference in New Issue
Block a user