mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-03 14:24:20 +01:00
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>
This commit is contained in:
committed by
Christian Decker
parent
81e55065d9
commit
61f048bbf1
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user