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

Function param_channel

lightningd/peer_htlcs.c:3206–3230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3204AUTODATA(json_command, &dev_ignore_htlcs);
3205
3206static struct command_result *param_channel(struct command *cmd,
3207 const char *name,
3208 const char *buffer,
3209 const jsmntok_t *tok,
3210 struct channel **chan)
3211{
3212 struct channel_id cid;
3213 struct short_channel_id scid;
3214
3215 if (json_tok_channel_id(buffer, tok, &cid)) {
3216 *chan = channel_by_cid(cmd->ld, &cid);
3217 if (!*chan)
3218 return command_fail_badparam(cmd, name, buffer, tok,
3219 "unknown channel");
3220 return NULL;
3221 } else if (json_to_short_channel_id(buffer, tok, &scid)) {
3222 *chan = any_channel_by_scid(cmd->ld, scid, true);
3223 if (!*chan)
3224 return command_fail_badparam(cmd, name, buffer, tok,
3225 "unknown channel");
3226 return NULL;
3227 }
3228 return command_fail_badparam(cmd, name, buffer, tok,
3229 "must be channel id or short channel id");
3230}
3231
3232static struct command_result *json_listhtlcs(struct command *cmd,
3233 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