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

Function wake_gossip

connectd/multiplex.c:602–622  ·  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

600
601/* Kicks off write_to_peer() to look for more gossip to send from store */
602static void wake_gossip(struct peer *peer)
603{
604 bool flush_gossip_filter = true;
605 /* With dev-fast-gossip, we clean every 2 seconds, which is too
606 * fast for our slow tests! So we only call this one time in 5
607 * actually twice that, as it's not per-peer! */
608 static int gossip_age_count;
609
610 if (peer->daemon->dev_fast_gossip && gossip_age_count++ % 5 != 0)
611 flush_gossip_filter = false;
612
613 /* Don't remember sent per-peer gossip forever. */
614 if (flush_gossip_filter)
615 gossip_rcvd_filter_age(peer->gs.grf);
616
617 peer->gs.active = !peer->daemon->dev_suppress_gossip;
618 io_wake(peer->peer_outq);
619
620 /* And go again in 60 seconds (from now, now when we finish!) */
621 peer->gs.gossip_timer = gossip_stream_timer(peer);
622}
623
624/* peer->gs's per-second budget: read_hdr_from_peer() and maybe_gossip_msg()
625 * both call this, so whichever notices the window has expired resets it

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