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

Function param_route_exclusion_array

common/json_param.c:1006–1035  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1004}
1005
1006struct command_result *
1007param_route_exclusion_array(struct command *cmd, const char *name,
1008 const char *buffer, const jsmntok_t *tok,
1009 struct route_exclusion ***res)
1010{
1011 size_t i;
1012 const jsmntok_t *curr;
1013 char *element_name;
1014 struct command_result *err;
1015 if (tok->type != JSMN_ARRAY) {
1016 return command_fail(
1017 cmd, JSONRPC2_INVALID_PARAMS,
1018 "Exclude array %s (\"%s\") is not an array",
1019 name, json_strdup(tmpctx, buffer, tok));
1020 }
1021
1022 *res = tal_arr(cmd, struct route_exclusion *, 0);
1023 json_for_each_arr(i, curr, tok) {
1024 struct route_exclusion *element;
1025 element_name = tal_fmt(cmd, "%s[%zu]", name, i);
1026 err = param_route_exclusion(cmd, element_name, buffer, curr, &element);
1027 if (err != NULL) {
1028 return err;
1029 }
1030 tal_arr_expand(res, element);
1031
1032 tal_free(element_name);
1033 }
1034 return NULL;
1035}
1036
1037struct command_result *param_lease_hex(struct command *cmd,
1038 const char *name,

Callers

nothing calls this directly

Calls 4

param_route_exclusionFunction · 0.85
tal_freeFunction · 0.85
json_strdupFunction · 0.70
command_failFunction · 0.50

Tested by

no test coverage detected