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

Function json_delforward

lightningd/forwards.c:264–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

262}
263
264static 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
294static const struct json_command delforward_command = {
295 "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