Turn unknown_scids map into a flat array, removes from map. */
| 247 | |
| 248 | /* Turn unknown_scids map into a flat array, removes from map. */ |
| 249 | static struct short_channel_id *unknown_scids_remove(const tal_t *ctx, |
| 250 | struct seeker *seeker) |
| 251 | { |
| 252 | struct short_channel_id *scids; |
| 253 | /* Marshal into an array: we can fit 8000 comfortably. */ |
| 254 | size_t i, max = 8000; |
| 255 | u64 scid; |
| 256 | |
| 257 | scids = tal_arr(ctx, struct short_channel_id, max); |
| 258 | i = 0; |
| 259 | while (uintmap_first(&seeker->unknown_scids, &scid)) { |
| 260 | scids[i].u64 = scid; |
| 261 | (void)uintmap_del(&seeker->unknown_scids, scid); |
| 262 | if (++i == max) |
| 263 | break; |
| 264 | } |
| 265 | tal_resize(&scids, i); |
| 266 | return scids; |
| 267 | } |
| 268 | |
| 269 | /* We have selected this peer to stream us startup gossip */ |
| 270 | static void peer_gossip_startup(struct seeker *seeker, struct peer *peer) |
no outgoing calls
no test coverage detected