MCPcopy Create free account
hub / github.com/ElementsProject/lightning / opt_node

Function opt_node

devtools/gossmap-compress.c:475–492  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

473}
474
475static 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
494static const char *get_alias(const tal_t *ctx,
495 const struct gossmap *gossmap,

Callers

nothing calls this directly

Calls 1

pubkey_from_hexstrFunction · 0.85

Tested by

no test coverage detected