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

Function param_channel

lightningd/peer_htlcs.c:3308–3332  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3306AUTODATA(json_command, &dev_ignore_htlcs);
3307
3308static struct command_result *param_channel(struct command *cmd,
3309 const char *name,
3310 const char *buffer,
3311 const jsmntok_t *tok,
3312 struct channel **chan)
3313{
3314 struct channel_id cid;
3315 struct short_channel_id scid;
3316
3317 if (json_tok_channel_id(buffer, tok, &cid)) {
3318 *chan = channel_by_cid(cmd->ld, &cid);
3319 if (!*chan)
3320 return command_fail_badparam(cmd, name, buffer, tok,
3321 "unknown channel");
3322 return NULL;
3323 } else if (json_to_short_channel_id(buffer, tok, &scid)) {
3324 *chan = any_channel_by_scid(cmd->ld, scid, true);
3325 if (!*chan)
3326 return command_fail_badparam(cmd, name, buffer, tok,
3327 "unknown channel");
3328 return NULL;
3329 }
3330 return command_fail_badparam(cmd, name, buffer, tok,
3331 "must be channel id or short channel id");
3332}
3333
3334static struct command_result *json_listhtlcs(struct command *cmd,
3335 const char *buffer,

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected