| 2972 | } |
| 2973 | |
| 2974 | static struct command_result *json_delforward(struct command *cmd, |
| 2975 | const char *buffer, |
| 2976 | const jsmntok_t *obj UNNEEDED, |
| 2977 | const jsmntok_t *params) |
| 2978 | { |
| 2979 | struct short_channel_id *chan_in; |
| 2980 | u64 *htlc_id; |
| 2981 | enum forward_status *status; |
| 2982 | |
| 2983 | if (!param(cmd, buffer, params, |
| 2984 | p_req("in_channel", param_short_channel_id, &chan_in), |
| 2985 | p_req("in_htlc_id", param_u64, &htlc_id), |
| 2986 | p_req("status", param_forward_delstatus, &status), |
| 2987 | NULL)) |
| 2988 | return command_param_failed(); |
| 2989 | |
| 2990 | #ifdef COMPAT_V0121 |
| 2991 | /* Special value used if in_htlc_id is missing */ |
| 2992 | if (*htlc_id == HTLC_INVALID_ID) |
| 2993 | htlc_id = NULL; |
| 2994 | #endif |
| 2995 | |
| 2996 | if (!wallet_forward_delete(cmd->ld->wallet, |
| 2997 | chan_in, htlc_id, *status)) |
| 2998 | return command_fail(cmd, DELFORWARD_NOT_FOUND, |
| 2999 | "Could not find that forward"); |
| 3000 | |
| 3001 | return command_success(cmd, json_stream_success(cmd)); |
| 3002 | } |
| 3003 | |
| 3004 | static const struct json_command delforward_command = { |
| 3005 | "delforward", |
nothing calls this directly
no test coverage detected