| 284 | } |
| 285 | |
| 286 | static void populate_node_map(const struct gossmap *gossmap, |
| 287 | struct node_map *node_map) |
| 288 | { |
| 289 | for (size_t i = 0; i < gossmap_max_node_idx(gossmap); i++) { |
| 290 | struct node *n = tal(node_map, struct node); |
| 291 | struct pubkey pubkey; |
| 292 | |
| 293 | /* gossmap-compress uses the node index (size_t, native endian), then all ones */ |
| 294 | memset(&n->p, 1, sizeof(n->p)); |
| 295 | memcpy(&n->p, &i, sizeof(i)); |
| 296 | n->name = tal_fmt(n, "node#%zu", i); |
| 297 | |
| 298 | pubkey_from_privkey(&n->p, &pubkey); |
| 299 | node_id_from_pubkey(&n->id, &pubkey); |
| 300 | node_map_add(node_map, n); |
| 301 | } |
| 302 | } |
| 303 | |
| 304 | /* Sets current_node, *next_onion_packet, *shared_secret and *me, and decodes */ |
| 305 | static struct onion_payload *decode_onion(const tal_t *ctx, |
no test coverage detected