Browse Source

channeld: allow gossipd to push any gossip msg through us.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
ppa-0.6.1
Rusty Russell 7 years ago
committed by Christian Decker
parent
commit
ee63ae8efa
  1. 11
      channeld/channel.c

11
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) static void gossip_in(struct peer *peer, const u8 *msg)
{ {
u8 *gossip; u8 *gossip;
u16 type;
if (!fromwire_gossip_send_gossip(msg, msg, if (!fromwire_gossip_send_gossip(msg, msg, &peer->gossip_index, &gossip))
&peer->gossip_index, &gossip))
status_failed(STATUS_FAIL_GOSSIP_IO, status_failed(STATUS_FAIL_GOSSIP_IO,
"Got bad message from gossipd: %s", "Got bad message from gossipd: %s",
tal_hex(msg, msg)); tal_hex(msg, msg));
type = fromwire_peektype(gossip);
if (type == WIRE_CHANNEL_ANNOUNCEMENT || type == WIRE_CHANNEL_UPDATE || if (is_msg_for_gossipd(gossip))
type == WIRE_NODE_ANNOUNCEMENT)
enqueue_peer_msg(peer, gossip); enqueue_peer_msg(peer, gossip);
else else
status_failed(STATUS_FAIL_GOSSIP_IO, status_failed(STATUS_FAIL_GOSSIP_IO,
"Got bad message type %s from gossipd: %s", "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 /* Send a temporary `channel_announcement` and `channel_update`. These

Loading…
Cancel
Save