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

Function param_outpoint_arr

common/json_param.c:954–979  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

952}
953
954struct command_result *param_outpoint_arr(struct command *cmd,
955 const char *name,
956 const char *buffer,
957 const jsmntok_t *tok,
958 struct bitcoin_outpoint **outpoints)
959{
960 size_t i;
961 const jsmntok_t *curr;
962 if (tok->type != JSMN_ARRAY) {
963 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
964 "Could not decode the outpoint array for %s: "
965 "\"%s\" is not a valid outpoint array.",
966 name, json_strdup(tmpctx, buffer, tok));
967 }
968
969 *outpoints = tal_arr(cmd, struct bitcoin_outpoint, tok->size);
970
971 json_for_each_arr(i, curr, tok) {
972 if (!json_to_outpoint(buffer, curr, &(*outpoints)[i]))
973 return command_fail(cmd, JSONRPC2_INVALID_PARAMS,
974 "Could not decode outpoint \"%.*s\", "
975 "expected format: txid:output",
976 json_tok_full_len(curr), json_tok_full(buffer, curr));
977 }
978 return NULL;
979}
980
981struct command_result *param_extra_tlvs(struct command *cmd, const char *name,
982 const char *buffer,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected