Skip to content

Commit

Permalink
gossip: rename is_gossip_msg to is_msg_for_gossipd.
Browse files Browse the repository at this point in the history
We're going to expand the range of messages which go through gossipd
when we support queries.

Signed-off-by: Rusty Russell <[email protected]>
  • Loading branch information
rustyrussell authored and cdecker committed Mar 13, 2018
1 parent 81e5506 commit 61f048b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion common/read_peer_msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion common/status.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
6 changes: 4 additions & 2 deletions wire/peer_wire.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions wire/peer_wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 61f048b

Please sign in to comment.