| 262 | } |
| 263 | |
| 264 | static struct command_result *json_delforward(struct command *cmd, |
| 265 | const char *buffer, |
| 266 | const jsmntok_t *obj UNNEEDED, |
| 267 | const jsmntok_t *params) |
| 268 | { |
| 269 | struct short_channel_id *chan_in; |
| 270 | u64 *htlc_id; |
| 271 | enum forward_status *status; |
| 272 | |
| 273 | if (!param(cmd, buffer, params, |
| 274 | p_req("in_channel", param_short_channel_id, &chan_in), |
| 275 | p_req("in_htlc_id", param_u64, &htlc_id), |
| 276 | p_req("status", param_forward_delstatus, &status), |
| 277 | NULL)) |
| 278 | return command_param_failed(); |
| 279 | |
| 280 | #ifdef COMPAT_V0121 |
| 281 | /* Special value used if in_htlc_id is missing */ |
| 282 | if (*htlc_id == HTLC_INVALID_ID) |
| 283 | htlc_id = NULL; |
| 284 | #endif |
| 285 | |
| 286 | if (!wallet_forward_delete(cmd->ld->wallet, |
| 287 | *chan_in, htlc_id, *status)) |
| 288 | return command_fail(cmd, DELFORWARD_NOT_FOUND, |
| 289 | "Could not find that forward"); |
| 290 | |
| 291 | return command_success(cmd, json_stream_success(cmd)); |
| 292 | } |
| 293 | |
| 294 | static const struct json_command delforward_command = { |
| 295 | "delforward", |
nothing calls this directly
no test coverage detected