| 1004 | } |
| 1005 | |
| 1006 | struct command_result * |
| 1007 | param_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 | |
| 1037 | struct command_result *param_lease_hex(struct command *cmd, |
| 1038 | const char *name, |
nothing calls this directly
no test coverage detected