Returns true if there were scids to seek. */
| 302 | |
| 303 | /* Returns true if there were scids to seek. */ |
| 304 | static 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 */ |
| 330 | static struct short_channel_id *stale_scids_remove(const tal_t *ctx, |
no test coverage detected