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

Function seek_any_unknown_scids

gossipd/seeker.c:304–327  ·  view source on GitHub ↗

Returns true if there were scids to seek. */

Source from the content-addressed store, hash-verified

302
303/* Returns true if there were scids to seek. */
304static bool seek_any_unknown_scids(struct seeker *seeker)
305{
306 struct peer *peer;
307 struct short_channel_id *scids;
308
309 /* Nothing we need to know about? */
310 if (uintmap_empty(&seeker->unknown_scids))
311 return false;
312
313 /* No peers can answer? Try again later. */
314 peer = random_seeker(seeker, peer_can_take_scid_query);
315 if (!peer)
316 return false;
317
318 scids = unknown_scids_remove(tmpctx, seeker);
319 set_state(seeker, ASKING_FOR_UNKNOWN_SCIDS, peer,
320 "Asking for %zu scids", tal_count(scids));
321 if (!query_short_channel_ids(seeker->daemon, peer, scids, NULL,
322 scid_query_done))
323 status_failed(STATUS_FAIL_INTERNAL_ERROR,
324 "seeker: quering %zu scids is too many?",
325 tal_count(scids));
326 return true;
327}
328
329/* Turns stale_scid_map into two arrays, and removes from map */
330static struct short_channel_id *stale_scids_remove(const tal_t *ctx,

Callers 1

seeker_checkFunction · 0.85

Calls 4

random_seekerFunction · 0.85
unknown_scids_removeFunction · 0.85
query_short_channel_idsFunction · 0.70
status_failedFunction · 0.50

Tested by

no test coverage detected