| 473 | } |
| 474 | |
| 475 | static char *opt_node(const char *optarg, const struct pubkey ***node_ids) |
| 476 | { |
| 477 | long num; |
| 478 | char *endl; |
| 479 | struct pubkey *pk; |
| 480 | |
| 481 | num = strtol(optarg, &endl, 10); |
| 482 | if (*endl != '=') |
| 483 | return tal_fmt(tmpctx, "Must be of form NUMBER '=' NODEID"); |
| 484 | |
| 485 | if (tal_count(*node_ids) <= num) |
| 486 | tal_resizez(node_ids, num + 1); |
| 487 | (*node_ids)[num] = pk = tal(*node_ids, struct pubkey); |
| 488 | |
| 489 | if (!pubkey_from_hexstr(endl + 1, strlen(endl + 1), pk)) |
| 490 | return tal_fmt(tmpctx, "Invalid node id '%s'", endl + 1); |
| 491 | return NULL; |
| 492 | } |
| 493 | |
| 494 | static const char *get_alias(const tal_t *ctx, |
| 495 | const struct gossmap *gossmap, |
nothing calls this directly
no test coverage detected