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

Function param_route_exclusion_array

common/json_param.c:1124–1153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1122}
1123
1124struct command_result *
1125param_route_exclusion_array(struct command *cmd, const char *name,
1126 const char *buffer, const jsmntok_t *tok,
1127 struct route_exclusion ***res)
1128{
1129 size_t i;
1130 const jsmntok_t *curr;
1131 char *element_name;
1132 struct command_result *err;
1133 if (tok->type != JSMN_ARRAY) {
1134 return command_fail(
1135 cmd, JSONRPC2_INVALID_PARAMS,
1136 "Exclude array %s (\"%s\") is not an array",
1137 name, json_strdup(tmpctx, buffer, tok));
1138 }
1139
1140 *res = tal_arr(cmd, struct route_exclusion *, 0);
1141 json_for_each_arr(i, curr, tok) {
1142 struct route_exclusion *element;
1143 element_name = tal_fmt(cmd, "%s[%zu]", name, i);
1144 err = param_route_exclusion(cmd, element_name, buffer, curr, &element);
1145 if (err != NULL) {
1146 return err;
1147 }
1148 tal_arr_expand(res, element);
1149
1150 tal_free(element_name);
1151 }
1152 return NULL;
1153}
1154
1155struct command_result *param_lease_hex(struct command *cmd,
1156 const char *name,

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected