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

Function param_channel

lightningd/peer_htlcs.c:3012–3036  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3010AUTODATA(json_command, &delforward_command);
3011
3012static struct command_result *param_channel(struct command *cmd,
3013 const char *name,
3014 const char *buffer,
3015 const jsmntok_t *tok,
3016 struct channel **chan)
3017{
3018 struct channel_id cid;
3019 struct short_channel_id scid;
3020
3021 if (json_tok_channel_id(buffer, tok, &cid)) {
3022 *chan = channel_by_cid(cmd->ld, &cid);
3023 if (!*chan)
3024 return command_fail_badparam(cmd, name, buffer, tok,
3025 "unknown channel");
3026 return NULL;
3027 } else if (json_to_short_channel_id(buffer, tok, &scid)) {
3028 *chan = any_channel_by_scid(cmd->ld, &scid, true);
3029 if (!*chan)
3030 return command_fail_badparam(cmd, name, buffer, tok,
3031 "unknown channel");
3032 return NULL;
3033 }
3034 return command_fail_badparam(cmd, name, buffer, tok,
3035 "must be channel id or short channel id");
3036}
3037
3038static struct command_result *json_listhtlcs(struct command *cmd,
3039 const char *buffer,

Callers

nothing calls this directly

Calls 5

channel_by_cidFunction · 0.85
command_fail_badparamFunction · 0.85
any_channel_by_scidFunction · 0.70
json_tok_channel_idFunction · 0.50
json_to_short_channel_idFunction · 0.50

Tested by

no test coverage detected