| 837 | } |
| 838 | |
| 839 | struct command_result *param_outpoint_arr(struct command *cmd, |
| 840 | const char *name, |
| 841 | const char *buffer, |
| 842 | const jsmntok_t *tok, |
| 843 | struct bitcoin_outpoint **outpoints) |
| 844 | { |
| 845 | size_t i; |
| 846 | const jsmntok_t *curr; |
| 847 | if (tok->type != JSMN_ARRAY) { |
| 848 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 849 | "Could not decode the outpoint array for %s: " |
| 850 | "\"%s\" is not a valid outpoint array.", |
| 851 | name, json_strdup(tmpctx, buffer, tok)); |
| 852 | } |
| 853 | |
| 854 | *outpoints = tal_arr(cmd, struct bitcoin_outpoint, tok->size); |
| 855 | |
| 856 | json_for_each_arr(i, curr, tok) { |
| 857 | if (!json_to_outpoint(buffer, curr, &(*outpoints)[i])) |
| 858 | return command_fail(cmd, JSONRPC2_INVALID_PARAMS, |
| 859 | "Could not decode outpoint \"%.*s\", " |
| 860 | "expected format: txid:output", |
| 861 | json_tok_full_len(curr), json_tok_full(buffer, curr)); |
| 862 | } |
| 863 | return NULL; |
| 864 | } |
| 865 | |
| 866 | struct command_result *param_extra_tlvs(struct command *cmd, const char *name, |
| 867 | const char *buffer, |
nothing calls this directly
no test coverage detected