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

Function seeker_check

gossipd/seeker.c:1039–1072  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1037
1038/* Periodic timer to see how our gossip is going. */
1039static void seeker_check(struct seeker *seeker)
1040{
1041 /* We don't do anything until we're synced. */
1042 if (seeker->daemon->current_blockheight == 0)
1043 goto out;
1044
1045 switch (seeker->state) {
1046 case STARTING_UP:
1047 check_firstpeer(seeker);
1048 break;
1049 case PROBING_SCIDS:
1050 check_probe(seeker, peer_gossip_probe_scids);
1051 break;
1052 case ASKING_FOR_UNKNOWN_SCIDS:
1053 check_probe(seeker, probe_many_random_scids);
1054 break;
1055 case ASKING_FOR_STALE_SCIDS:
1056 check_probe(seeker, probe_some_random_scids);
1057 break;
1058 case PROBING_NANNOUNCES:
1059 check_probe(seeker, peer_gossip_probe_nannounces);
1060 break;
1061 case NORMAL:
1062 maybe_get_new_peer(seeker);
1063 maybe_rotate_gossipers(seeker);
1064 if (!seek_any_unknown_scids(seeker)
1065 && !seek_any_stale_scids(seeker))
1066 seek_any_unknown_nodes(seeker);
1067 break;
1068 }
1069
1070out:
1071 begin_check_timer(seeker);
1072}
1073
1074/* Mutual recursion */
1075static void begin_sync_timer(struct seeker *seeker);

Callers

nothing calls this directly

Calls 8

check_firstpeerFunction · 0.85
check_probeFunction · 0.85
maybe_get_new_peerFunction · 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