From 61f048bbf1c52fd0c6a7541c14bc4d81f957afa6 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Mar 2018 13:47:05 +1030 Subject: [PATCH] gossip: rename is_gossip_msg to is_msg_for_gossipd. We're going to expand the range of messages which go through gossipd when we support queries. Signed-off-by: Rusty Russell --- common/read_peer_msg.c | 2 +- common/status.c | 2 +- wire/peer_wire.c | 6 ++++-- wire/peer_wire.h | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/common/read_peer_msg.c b/common/read_peer_msg.c index 0e0e54f05..33a972595 100644 --- a/common/read_peer_msg.c +++ b/common/read_peer_msg.c @@ -54,7 +54,7 @@ u8 *read_peer_msg_(const tal_t *ctx, if (!msg) io_error(arg); - if (is_gossip_msg(msg)) { + if (is_msg_for_gossipd(msg)) { /* Forward to gossip daemon */ wire_sync_write(gossip_fd, take(msg)); return NULL; diff --git a/common/status.c b/common/status.c index 640923945..7e5ccacee 100644 --- a/common/status.c +++ b/common/status.c @@ -85,7 +85,7 @@ void status_io(enum log_level iodir, const u8 *p) if (logging_io) status_io_full(iodir, p); /* We get a huge amount of gossip; don't log it */ - else if (!is_gossip_msg(p)) + else if (!is_msg_for_gossipd(p)) status_io_short(iodir, p); } diff --git a/wire/peer_wire.c b/wire/peer_wire.c index 9e2f30eae..f13602fa8 100644 --- a/wire/peer_wire.c +++ b/wire/peer_wire.c @@ -31,9 +31,9 @@ static bool unknown_type(enum wire_type t) return true; } -bool is_gossip_msg(const u8 *cursor) +bool is_msg_for_gossipd(const u8 *cursor) { - switch (fromwire_peektype(cursor)) { + switch ((enum wire_type)fromwire_peektype(cursor)) { case WIRE_CHANNEL_ANNOUNCEMENT: case WIRE_NODE_ANNOUNCEMENT: case WIRE_CHANNEL_UPDATE: @@ -56,6 +56,8 @@ bool is_gossip_msg(const u8 *cursor) case WIRE_UPDATE_FEE: case WIRE_PING: case WIRE_PONG: + case WIRE_CHANNEL_REESTABLISH: + case WIRE_ANNOUNCEMENT_SIGNATURES: break; } return false; diff --git a/wire/peer_wire.h b/wire/peer_wire.h index 499359ff0..acd51791b 100644 --- a/wire/peer_wire.h +++ b/wire/peer_wire.h @@ -16,8 +16,8 @@ bool is_unknown_msg(const u8 *cursor); /* Return true if it's an unknown ODD message. cursor is a tal ptr. */ bool is_unknown_msg_discardable(const u8 *cursor); -/* Return true if it's a gossip message. */ -bool is_gossip_msg(const u8 *cursor); +/* Return true if it's a message for gossipd. */ +bool is_msg_for_gossipd(const u8 *cursor); /* Extract channel_id from various packets, return true if possible. */ bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id);