Turn unknown_scids map into a flat array, removes from map. */
| 290 | |
| 291 | /* Turn unknown_scids map into a flat array, removes from map. */ |
| 292 | static struct short_channel_id *unknown_scids_remove(const tal_t *ctx, |
| 293 | struct seeker *seeker) |
| 294 | { |
| 295 | struct short_channel_id *scids; |
| 296 | /* Marshal into an array: we can fit 8000 comfortably. */ |
| 297 | size_t i, max = 8000; |
| 298 | u64 scid; |
| 299 | |
| 300 | scids = tal_arr(ctx, struct short_channel_id, max); |
| 301 | i = 0; |
| 302 | while (uintmap_first(&seeker->unknown_scids, &scid)) { |
| 303 | scids[i].u64 = scid; |
| 304 | (void)uintmap_del(&seeker->unknown_scids, scid); |
| 305 | seeker->num_unknown_scids--; |
| 306 | if (++i == max) |
| 307 | break; |
| 308 | } |
| 309 | tal_resize(&scids, i); |
| 310 | return scids; |
| 311 | } |
| 312 | |
| 313 | /* We have selected this peer to stream us startup gossip */ |
| 314 | static void peer_gossip_startup(struct seeker *seeker, struct peer *peer, |
no outgoing calls
no test coverage detected