| 1122 | } |
| 1123 | |
| 1124 | struct command_result * |
| 1125 | param_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 | |
| 1155 | struct command_result *param_lease_hex(struct command *cmd, |
| 1156 | const char *name, |
nothing calls this directly
no test coverage detected