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

Function seeker_check

gossipd/seeker.c:862–894  ·  view source on GitHub ↗

Periodic timer to see how our gossip is going. */

Source from the content-addressed store, hash-verified

860
861/* Periodic timer to see how our gossip is going. */
862static void seeker_check(struct seeker *seeker)
863{
864 /* We don't do anything until we're synced. */
865 if (seeker->daemon->current_blockheight == 0)
866 goto out;
867
868 switch (seeker->state) {
869 case STARTING_UP:
870 check_firstpeer(seeker);
871 break;
872 case PROBING_SCIDS:
873 check_probe(seeker, peer_gossip_probe_scids);
874 break;
875 case ASKING_FOR_UNKNOWN_SCIDS:
876 check_probe(seeker, probe_many_random_scids);
877 break;
878 case ASKING_FOR_STALE_SCIDS:
879 check_probe(seeker, probe_some_random_scids);
880 break;
881 case PROBING_NANNOUNCES:
882 check_probe(seeker, peer_gossip_probe_nannounces);
883 break;
884 case NORMAL:
885 maybe_rotate_gossipers(seeker);
886 if (!seek_any_unknown_scids(seeker)
887 && !seek_any_stale_scids(seeker))
888 seek_any_unknown_nodes(seeker);
889 break;
890 }
891
892out:
893 begin_check_timer(seeker);
894}
895
896/* We get this when we have a new peer. */
897void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer)

Callers

nothing calls this directly

Calls 7

check_firstpeerFunction · 0.85
check_probeFunction · 0.85
maybe_rotate_gossipersFunction · 0.85
seek_any_unknown_scidsFunction · 0.85
seek_any_stale_scidsFunction · 0.85
seek_any_unknown_nodesFunction · 0.85
begin_check_timerFunction · 0.85

Tested by

no test coverage detected