MCPcopy Create free account
hub / github.com/ElementsProject/lightning / wake_gossip

Function wake_gossip

connectd/multiplex.c:470–493  ·  view source on GitHub ↗

Kicks off write_to_peer() to look for more gossip to send from store */

Source from the content-addressed store, hash-verified

468
469/* Kicks off write_to_peer() to look for more gossip to send from store */
470static void wake_gossip(struct peer *peer)
471{
472 bool flush_gossip_filter = true;
473
474#if DEVELOPER
475 /* With dev-fast-gossip, we clean every 2 seconds, which is too
476 * fast for our slow tests! So we only call this one time in 5
477 * actually twice that, as it's not per-peer! */
478 static int gossip_age_count;
479
480 if (peer->daemon->dev_fast_gossip && gossip_age_count++ % 5 != 0)
481 flush_gossip_filter = false;
482#endif
483
484 /* Don't remember sent per-peer gossip forever. */
485 if (flush_gossip_filter)
486 gossip_rcvd_filter_age(peer->gs.grf);
487
488 peer->gs.active = IFDEV(!peer->daemon->dev_suppress_gossip, true);
489 io_wake(peer->peer_outq);
490
491 /* And go again in 60 seconds (from now, now when we finish!) */
492 peer->gs.gossip_timer = gossip_stream_timer(peer);
493}
494
495/* If we are streaming gossip, get something from gossip store */
496static u8 *maybe_from_gossip_store(const tal_t *ctx, struct peer *peer)

Callers 1

Calls 3

gossip_rcvd_filter_ageFunction · 0.85
io_wakeFunction · 0.85
gossip_stream_timerFunction · 0.85

Tested by

no test coverage detected