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

Function param_pubkey_arr

plugins/offers_offer.c:456–478  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

454}
455
456static struct command_result *param_pubkey_arr(struct command *cmd,
457 const char *name,
458 const char *buffer,
459 const jsmntok_t *tok,
460 const struct pubkey **keys)
461{
462 size_t i;
463 const jsmntok_t *t;
464 struct pubkey *arr;
465
466 if (tok->type != JSMN_ARRAY)
467 return command_fail_badparam(cmd, name, buffer, tok,
468 "should be an array of nodes");
469
470 arr = tal_arr(cmd, struct pubkey, tok->size);
471 json_for_each_arr(i, t, tok) {
472 if (!json_to_pubkey(buffer, t, &arr[i]))
473 return command_fail_badparam(cmd, name, buffer, t,
474 "invalid pubkey");
475 }
476 *keys = arr;
477 return NULL;
478}
479
480struct command_result *json_offer(struct command *cmd,
481 const char *buffer,

Callers

nothing calls this directly

Calls 2

command_fail_badparamFunction · 0.50
json_to_pubkeyFunction · 0.50

Tested by

no test coverage detected