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

Function param_outpoint_arr

common/json_param.c:839–864  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

837}
838
839struct command_result *param_outpoint_arr(struct command *cmd,
840 const char *name,
841 const char *buffer,
842 const jsmntok_t *tok,
843 struct bitcoin_outpoint **outpoints)
844{
845 size_t i;
846 const jsmntok_t *curr;
847 if (tok->type != JSMN_ARRAY) {
848 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
849 "Could not decode the outpoint array for %s: "
850 "\"%s\" is not a valid outpoint array.",
851 name, json_strdup(tmpctx, buffer, tok));
852 }
853
854 *outpoints = tal_arr(cmd, struct bitcoin_outpoint, tok->size);
855
856 json_for_each_arr(i, curr, tok) {
857 if (!json_to_outpoint(buffer, curr, &(*outpoints)[i]))
858 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
859 "Could not decode outpoint \"%.*s\", "
860 "expected format: txid:output",
861 json_tok_full_len(curr), json_tok_full(buffer, curr));
862 }
863 return NULL;
864}
865
866struct command_result *param_extra_tlvs(struct command *cmd, const char *name,
867 const char *buffer,

Callers

nothing calls this directly

Calls 5

json_strdupFunction · 0.70
json_to_outpointFunction · 0.70
json_tok_full_lenFunction · 0.70
json_tok_fullFunction · 0.70
command_failFunction · 0.50

Tested by

no test coverage detected