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

Function param_pubkey_arr

plugins/offers_offer.c:451–473  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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