From ee63ae8efa67fb9817110913831d181c1696b3dc Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 8 Mar 2018 13:47:44 +1030 Subject: [PATCH] channeld: allow gossipd to push any gossip msg through us. Signed-off-by: Rusty Russell --- channeld/channel.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/channeld/channel.c b/channeld/channel.c index 8b1d979f9..0dcaeb065 100644 --- a/channeld/channel.c +++ b/channeld/channel.c @@ -306,22 +306,19 @@ static void enqueue_peer_msg(struct peer *peer, const u8 *msg TAKES) static void gossip_in(struct peer *peer, const u8 *msg) { u8 *gossip; - u16 type; - if (!fromwire_gossip_send_gossip(msg, msg, - &peer->gossip_index, &gossip)) + if (!fromwire_gossip_send_gossip(msg, msg, &peer->gossip_index, &gossip)) status_failed(STATUS_FAIL_GOSSIP_IO, "Got bad message from gossipd: %s", tal_hex(msg, msg)); - type = fromwire_peektype(gossip); - if (type == WIRE_CHANNEL_ANNOUNCEMENT || type == WIRE_CHANNEL_UPDATE || - type == WIRE_NODE_ANNOUNCEMENT) + if (is_msg_for_gossipd(gossip)) enqueue_peer_msg(peer, gossip); else status_failed(STATUS_FAIL_GOSSIP_IO, "Got bad message type %s from gossipd: %s", - wire_type_name(type), tal_hex(msg, msg)); + wire_type_name(fromwire_peektype(gossip)), + tal_hex(msg, msg)); } /* Send a temporary `channel_announcement` and `channel_update`. These