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 <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-03-22 07:46:17 +10:30 committed by ShahanaFarooqui
parent 46bb6beee7
commit 00f75d6ee1

View file

@ -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)) if (IFDEV(peer->daemon->dev_suppress_gossip, false))
return NULL; 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? */ /* Not streaming right now? */
if (!peer->gs.active) if (!peer->gs.active)
return NULL; return NULL;