| 710 | bool *changed); |
| 711 | |
| 712 | static void init_map_structs(struct gossmap *map) |
| 713 | { |
| 714 | /* Since channel_announcement is ~430 bytes, and channel_update is 136, |
| 715 | * node_announcement is 144, and current topology has 35000 channels |
| 716 | * and 10000 nodes, let's assume each channel gets about 750 bytes. |
| 717 | * |
| 718 | * We halve this, since often some records are deleted. */ |
| 719 | map->channels = tal(map, struct chanidx_htable); |
| 720 | chanidx_htable_init_sized(map->channels, map->map_size / 750 / 2); |
| 721 | map->nodes = tal(map, struct nodeidx_htable); |
| 722 | nodeidx_htable_init_sized(map->nodes, map->map_size / 2500 / 2); |
| 723 | |
| 724 | map->num_chan_arr = map->map_size / 750 / 2 + 1; |
| 725 | map->chan_arr = tal_arr(map, struct gossmap_chan, map->num_chan_arr); |
| 726 | map->freed_chans = init_chan_arr(map->chan_arr, 0); |
| 727 | map->num_node_arr = map->map_size / 2500 / 2 + 1; |
| 728 | map->node_arr = tal_arr(map, struct gossmap_node, map->num_node_arr); |
| 729 | map->freed_nodes = init_node_arr(map->node_arr, 0); |
| 730 | } |
| 731 | |
| 732 | static bool reopen_store(struct gossmap *map, u64 ended_off) |
| 733 | { |
no test coverage detected