MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_delforward

Function json_delforward

lightningd/peer_htlcs.c:2974–3002  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2972}
2973
2974static 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
3004static const struct json_command delforward_command = {
3005 "delforward",

Callers

nothing calls this directly

Calls 6

wallet_forward_deleteFunction · 0.85
command_param_failedFunction · 0.70
command_failFunction · 0.70
command_successFunction · 0.70
json_stream_successFunction · 0.70
paramFunction · 0.50

Tested by

no test coverage detected