| 2913 | } |
| 2914 | |
| 2915 | static struct command_result *json_listforwards(struct command *cmd, |
| 2916 | const char *buffer, |
| 2917 | const jsmntok_t *obj UNNEEDED, |
| 2918 | const jsmntok_t *params) |
| 2919 | { |
| 2920 | |
| 2921 | struct json_stream *response; |
| 2922 | struct short_channel_id *chan_in, *chan_out; |
| 2923 | enum forward_status *status; |
| 2924 | |
| 2925 | if (!param(cmd, buffer, params, |
| 2926 | p_opt_def("status", param_forward_status, &status, |
| 2927 | FORWARD_ANY), |
| 2928 | p_opt("in_channel", param_short_channel_id, &chan_in), |
| 2929 | p_opt("out_channel", param_short_channel_id, &chan_out), |
| 2930 | NULL)) |
| 2931 | return command_param_failed(); |
| 2932 | |
| 2933 | response = json_stream_success(cmd); |
| 2934 | listforwardings_add_forwardings(response, cmd->ld->wallet, *status, chan_in, chan_out); |
| 2935 | |
| 2936 | return command_success(cmd, response); |
| 2937 | } |
| 2938 | |
| 2939 | static const struct json_command listforwards_command = { |
| 2940 | "listforwards", |
nothing calls this directly
no test coverage detected