mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
channeld: allow gossipd to push any gossip msg through us.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
61f048bbf1
commit
ee63ae8efa
@ -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…
Reference in New Issue
Block a user