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

Function param_pubkeys

lightningd/onion_message.c:270–290  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

268AUTODATA(json_command, &sendonionmessage_command);
269
270static struct command_result *param_pubkeys(struct command *cmd,
271 const char *name,
272 const char *buffer,
273 const jsmntok_t *tok,
274 struct pubkey **pubkeys)
275{
276 size_t i;
277 const jsmntok_t *t;
278
279 if (tok->type != JSMN_ARRAY || tok->size == 0)
280 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
281 "%s must be an (non-empty) array", name);
282
283 *pubkeys = tal_arr(cmd, struct pubkey, tok->size);
284 json_for_each_arr(i, t, tok) {
285 if (!json_to_pubkey(buffer, t, &(*pubkeys)[i]))
286 return command_fail_badparam(cmd, name, buffer, t,
287 "should be a compressed pubkey");
288 }
289 return NULL;
290}
291
292static struct command_result *json_blindedpath(struct command *cmd,
293 const char *buffer,

Callers

nothing calls this directly

Calls 3

command_fail_badparamFunction · 0.85
command_failFunction · 0.70
json_to_pubkeyFunction · 0.50

Tested by

no test coverage detected