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

Function json_listforwards

lightningd/peer_htlcs.c:2915–2937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2913}
2914
2915static 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
2939static const struct json_command listforwards_command = {
2940 "listforwards",

Callers

nothing calls this directly

Calls 5

command_param_failedFunction · 0.70
json_stream_successFunction · 0.70
command_successFunction · 0.70
paramFunction · 0.50

Tested by

no test coverage detected