Browse Source

common/daemon_conn: add daemon_conn_wake() helper.

We've been open-coding it.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
parent
commit
f747ad8f73
  1. 5
      common/daemon_conn.c
  2. 5
      common/daemon_conn.h
  3. 4
      gossipd/gossip.c

5
common/daemon_conn.c

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

5
common/daemon_conn.h

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

4
gossipd/gossip.c

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