diff --git a/gossipd/gossipd.c b/gossipd/gossipd.c index e87dd8ae37db..00ea429ec851 100644 --- a/gossipd/gossipd.c +++ b/gossipd/gossipd.c @@ -534,7 +534,10 @@ static void inject_gossip(struct daemon *daemon, const u8 *msg) case WIRE_CHANNEL_UPDATE: err = gossmap_manage_channel_update(tmpctx, daemon->gm, - take(goss), NULL); + goss, NULL); + if (err) + status_debug("update %s gave error %s", + tal_hex(tmpctx, goss), err); break; default: err = tal_fmt(tmpctx, "unknown gossip type %i", diff --git a/gossipd/gossmap_manage.c b/gossipd/gossmap_manage.c index 596d200df3db..77f9c2b1548d 100644 --- a/gossipd/gossmap_manage.c +++ b/gossipd/gossmap_manage.c @@ -734,8 +734,11 @@ static const char *process_channel_update(const tal_t *ctx, chan = gossmap_find_chan(gossmap, &scid); if (!chan) { /* Did we explicitly reject announce? Ignore completely. */ - if (in_txout_failures(gm->txf, scid)) + if (in_txout_failures(gm->txf, scid)) { + status_debug("Previously-rejected announce for %s", + fmt_short_channel_id(tmpctx, scid)); return NULL; + } /* Seeker may want to ask about this. */ query_unknown_channel(gm->daemon, source_peer, scid); @@ -767,6 +770,8 @@ static const char *process_channel_update(const tal_t *ctx, u32 prev_timestamp = gossip_store_get_timestamp(gm->daemon->gs, chan->cupdate_off[dir]); if (prev_timestamp >= timestamp) { + status_debug("Too-old update for %s", + fmt_short_channel_id(tmpctx, scid)); /* Too old, ignore */ return NULL; } @@ -850,11 +855,15 @@ const char *gossmap_manage_channel_update(const tal_t *ctx, } /* Don't accept ancient or far-future timestamps. */ - if (!timestamp_reasonable(gm->daemon, timestamp)) + if (!timestamp_reasonable(gm->daemon, timestamp)) { + status_debug("Unreasonable timestamp in %s", tal_hex(tmpctx, update)); return NULL; + } /* Still waiting? */ if (map_get(&gm->pending_ann_map, scid)) { + status_debug("Enqueueing update for announcne %s", + tal_hex(tmpctx, update)); enqueue_cupdate(&gm->pending_cupdates, scid, &signature, @@ -873,6 +882,8 @@ const char *gossmap_manage_channel_update(const tal_t *ctx, /* Too early? */ if (map_get(&gm->early_ann_map, scid)) { + status_debug("Enqueueing update for too early %s", + tal_hex(tmpctx, update)); enqueue_cupdate(&gm->early_cupdates, scid, &signature, diff --git a/tests/test_gossip.py b/tests/test_gossip.py index 700db4296608..636282b3a282 100644 --- a/tests/test_gossip.py +++ b/tests/test_gossip.py @@ -1845,8 +1845,8 @@ def test_addgossip(node_factory): opts={'log-level': 'io'}) # We should get two node_announcements, one channel_announcement, and two - # channel_update. - l3 = node_factory.get_node() + # channel_update. We deliberately inject bad gossip! + l3 = node_factory.get_node(allow_bad_gossip=True) # 0x0100 = channel_announcement # 0x0102 = channel_update