From 00f75d6ee11290fa1c6431b69ce4fc6f1680a232 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 22 Mar 2023 07:46:17 +1030 Subject: [PATCH] connectd: no longer stream our own generated gossip, let gossipd do it. This removes the sweep logic as soon as they connect. This should save connectd a significant number of CPU cycles and make @whitslack finally stop hitting me. Changelog-Changed: `connectd` no longer sweeps gossip_store file when peer connects, saving CPU for large nodes. Signed-off-by: Rusty Russell --- connectd/multiplex.c | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/connectd/multiplex.c b/connectd/multiplex.c index f8eeb31b7..8d9e780b6 100644 --- a/connectd/multiplex.c +++ b/connectd/multiplex.c @@ -505,23 +505,6 @@ static u8 *maybe_from_gossip_store(const tal_t *ctx, struct peer *peer) 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, - false, - &peer->gs.off, - &peer->daemon->gossip_store_end); - } - /* Not streaming right now? */ if (!peer->gs.active) return NULL;