From a5d027cefcd7b8feb34dfa4c5b5ba7dae4ab6d3a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 20 Apr 2022 07:23:02 +0930 Subject: [PATCH] connectd: send our own gossip, even if peer hasn't sent timestamp_filter. We seem to have made node_announcement propagation *worse*, not better. Explorers don't see my nodes updates. At least some LND nodes never send us timestamp_filter, so we are never actually stream *any* gossip. We should send gossip about ourselves, even if they haven't set a filter (yet). Signed-off-by: Rusty Russell Changelog-Added: Protocol: we more aggressively send our own gossip, to improve propagation chances. --- connectd/multiplex.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/connectd/multiplex.c b/connectd/multiplex.c index 8a94a33ee..118f31897 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -356,7 +356,27 @@ static u8 *maybe_from_gossip_store(const tal_t *ctx, struct peer *peer) { u8 *msg; - /* Not streaming yet? */ + /* dev-mode can suppress all gossip */ + if (IFDEV(peer->daemon->dev_suppress_gossip, false)) + return NULL; + + /* BOLT #7: + * - if the `gossip_queries` feature is negotiated: + * - MUST NOT relay any gossip messages it did not generate itself, + * unless explicitly requested. + */ + + /* So, even if they didn't send us a timestamp_filter message, + * we *still* send our own gossip. */ + if (!peer->gs.gossip_timer) { + return gossip_store_next(ctx, &peer->daemon->gossip_store_fd, + 0, 0xFFFFFFFF, + true, + &peer->gs.off, + &peer->daemon->gossip_store_end); + } + + /* Not streaming right now? */ if (!peer->gs.active) return NULL;