channeld: allow gossipd to fwd messages through us without updating gossip_index.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2018-03-08 13:54:13 +10:30 committed by Christian Decker
parent c8294c4091
commit 61e3c0c23e

View file

@ -306,12 +306,17 @@ static void enqueue_peer_msg(struct peer *peer, const u8 *msg TAKES)
static void gossip_in(struct peer *peer, const u8 *msg)
{
u8 *gossip;
u64 gossip_index;
if (!fromwire_gossip_send_gossip(msg, msg, &peer->gossip_index, &gossip))
if (!fromwire_gossip_send_gossip(msg, msg, &gossip_index, &gossip))
status_failed(STATUS_FAIL_GOSSIP_IO,
"Got bad message from gossipd: %s",
tal_hex(msg, msg));
/* Zero is a special index meaning this is unindexed gossip. */
if (gossip_index != 0)
peer->gossip_index = gossip_index;
if (is_msg_for_gossipd(gossip))
enqueue_peer_msg(peer, gossip);
else if (fromwire_peektype(gossip) == WIRE_ERROR) {