Browse Source

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 <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
61f048bbf1
  1. 2
      common/read_peer_msg.c
  2. 2
      common/status.c
  3. 6
      wire/peer_wire.c
  4. 4
      wire/peer_wire.h

2
common/read_peer_msg.c

@ -54,7 +54,7 @@ u8 *read_peer_msg_(const tal_t *ctx,
if (!msg) if (!msg)
io_error(arg); io_error(arg);
if (is_gossip_msg(msg)) { if (is_msg_for_gossipd(msg)) {
/* Forward to gossip daemon */ /* Forward to gossip daemon */
wire_sync_write(gossip_fd, take(msg)); wire_sync_write(gossip_fd, take(msg));
return NULL; return NULL;

2
common/status.c

@ -85,7 +85,7 @@ void status_io(enum log_level iodir, const u8 *p)
if (logging_io) if (logging_io)
status_io_full(iodir, p); status_io_full(iodir, p);
/* We get a huge amount of gossip; don't log it */ /* 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); status_io_short(iodir, p);
} }

6
wire/peer_wire.c

@ -31,9 +31,9 @@ static bool unknown_type(enum wire_type t)
return true; 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_CHANNEL_ANNOUNCEMENT:
case WIRE_NODE_ANNOUNCEMENT: case WIRE_NODE_ANNOUNCEMENT:
case WIRE_CHANNEL_UPDATE: case WIRE_CHANNEL_UPDATE:
@ -56,6 +56,8 @@ bool is_gossip_msg(const u8 *cursor)
case WIRE_UPDATE_FEE: case WIRE_UPDATE_FEE:
case WIRE_PING: case WIRE_PING:
case WIRE_PONG: case WIRE_PONG:
case WIRE_CHANNEL_REESTABLISH:
case WIRE_ANNOUNCEMENT_SIGNATURES:
break; break;
} }
return false; return false;

4
wire/peer_wire.h

@ -16,8 +16,8 @@
bool is_unknown_msg(const u8 *cursor); bool is_unknown_msg(const u8 *cursor);
/* Return true if it's an unknown ODD message. cursor is a tal ptr. */ /* Return true if it's an unknown ODD message. cursor is a tal ptr. */
bool is_unknown_msg_discardable(const u8 *cursor); bool is_unknown_msg_discardable(const u8 *cursor);
/* Return true if it's a gossip message. */ /* Return true if it's a message for gossipd. */
bool is_gossip_msg(const u8 *cursor); bool is_msg_for_gossipd(const u8 *cursor);
/* Extract channel_id from various packets, return true if possible. */ /* Extract channel_id from various packets, return true if possible. */
bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id); bool extract_channel_id(const u8 *in_pkt, struct channel_id *channel_id);

Loading…
Cancel
Save