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

Function seeker_setup_peer_gossip

gossipd/seeker.c:897–924  ·  view source on GitHub ↗

We get this when we have a new peer. */

Source from the content-addressed store, hash-verified

895
896/* We get this when we have a new peer. */
897void seeker_setup_peer_gossip(struct seeker *seeker, struct peer *peer)
898{
899 /* Can't do anything useful with these peers. */
900 if (!peer->gossip_queries_feature)
901 return;
902
903 /* Don't start gossiping until we're synced. */
904 if (seeker->daemon->current_blockheight == 0)
905 return;
906
907 switch (seeker->state) {
908 case STARTING_UP:
909 if (seeker->random_peer_softref == NULL)
910 peer_gossip_startup(seeker, peer);
911 /* Waiting for seeker_check to release us */
912 return;
913
914 /* In these states, we set up peers to stream gossip normally */
915 case PROBING_SCIDS:
916 case PROBING_NANNOUNCES:
917 case NORMAL:
918 case ASKING_FOR_UNKNOWN_SCIDS:
919 case ASKING_FOR_STALE_SCIDS:
920 normal_gossip_start(seeker, peer);
921 return;
922 }
923 abort();
924}
925
926bool remove_unknown_scid(struct seeker *seeker,
927 const struct short_channel_id *scid,

Callers 1

connectd_new_peerFunction · 0.85

Calls 3

peer_gossip_startupFunction · 0.85
normal_gossip_startFunction · 0.85
abortFunction · 0.85

Tested by

no test coverage detected