| 952 | } |
| 953 | |
| 954 | struct 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 | |
| 981 | struct command_result *param_extra_tlvs(struct command *cmd, const char *name, |
| 982 | const char *buffer, |
nothing calls this directly
no test coverage detected