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

Function next_random_peer

gossipd/gossipd.c:352–366  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

350}
351
352struct peer *next_random_peer(struct daemon *daemon,
353 const struct peer *first,
354 struct peer_node_id_map_iter *it)
355{
356 struct peer *p;
357
358 p = peer_node_id_map_next(daemon->peers, it);
359 if (!p)
360 p = peer_node_id_map_first(daemon->peers, it);
361
362 /* Full circle? */
363 if (p == first)
364 return NULL;
365 return p;
366}
367
368/* This is called when lightningd or connectd closes its connection to
369 * us. We simply exit. */

Callers 2

random_seekerFunction · 0.70
full_sync_random_peerFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected