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

Function normal_gossip_start

gossipd/seeker.c:262–289  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262static void normal_gossip_start(struct seeker *seeker, struct peer *peer, bool ask_for_all)
263{
264 bool enable_stream = false;
265
266 /* BOLT-remove-old-features #7:
267 * Understanding of messages used to be indicated with the `gossip_queries`
268 * feature bit; now these messages are universally supported, that feature has
269 * now been slightly repurposed. Not offering this feature means a node is not
270 * worth querying for gossip: either they do not store the entire gossip map, or
271 * they are only connected to a single peer (this one).
272 */
273 if (!peer->gossip_queries_feature)
274 return;
275
276 /* Make this one of our streaming gossipers if we aren't full */
277 for (size_t i = 0; i < tal_count(seeker->gossiper); i++) {
278 if (seeker->gossiper[i] == NULL) {
279 seeker->gossiper[i] = peer;
280 enable_stream = true;
281 break;
282 }
283 }
284
285 if (enable_stream)
286 enable_gossip_stream(seeker, peer, ask_for_all);
287 else
288 disable_gossip_stream(seeker, peer);
289}
290
291/* Turn unknown_scids map into a flat array, removes from map. */
292static struct short_channel_id *unknown_scids_remove(const tal_t *ctx,

Callers 4

peer_gossip_startupFunction · 0.85
check_firstpeerFunction · 0.85
full_sync_random_peerFunction · 0.85
seeker_setup_peer_gossipFunction · 0.85

Calls 2

enable_gossip_streamFunction · 0.85
disable_gossip_streamFunction · 0.85

Tested by

no test coverage detected