Freelist links through scid of unused entries. */
| 326 | |
| 327 | /* Freelist links through scid of unused entries. */ |
| 328 | static struct gossmap_chan *next_free_chan(struct gossmap *map) |
| 329 | { |
| 330 | size_t f; |
| 331 | |
| 332 | if (map->freed_chans == UINT_MAX) { |
| 333 | /* Double in size, add second half to free list */ |
| 334 | size_t n = tal_count(map->chan_arr); |
| 335 | map->num_chan_arr *= 2; |
| 336 | tal_resize(&map->chan_arr, n * 2); |
| 337 | map->freed_chans = init_chan_arr(map->chan_arr, n); |
| 338 | } |
| 339 | |
| 340 | f = map->freed_chans; |
| 341 | map->freed_chans = map->chan_arr[f].cann_off; |
| 342 | return &map->chan_arr[f]; |
| 343 | } |
| 344 | |
| 345 | static struct gossmap_chan *new_channel(struct gossmap *map, |
| 346 | u32 cannounce_off, |
no test coverage detected