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 <rusty@rustcorp.com.au>
Changelog-Added: Protocol: we more aggressively send our own gossip, to improve propagation chances.
This commit is contained in:
Rusty Russell 2022-04-20 07:23:02 +09:30
parent 9b944dbed4
commit a5d027cefc

View File

@ -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;