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

Function param_dev_channel

lightningd/peer_control.c:3993–4018  ·  view source on GitHub ↗

dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */

Source from the content-addressed store, hash-verified

3991
3992/* dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */
3993static struct command_result *param_dev_channel(struct command *cmd,
3994 const char *name,
3995 const char *buffer,
3996 const jsmntok_t *tok,
3997 struct channel **channel)
3998{
3999 struct peer *peer COMPILER_WANTS_INIT("gcc version 12.3.0 -O3");
4000 struct command_result *res;
4001 bool more_than_one;
4002
4003 res = param_peer(cmd, name, buffer, tok, &peer);
4004 if (res)
4005 return res;
4006
4007 *channel = peer_any_channel_bystate(peer, channel_state_wants_peercomms,
4008 &more_than_one);
4009 if (!*channel)
4010 return command_fail_badparam(cmd, name, buffer, tok,
4011 "No channel with that peer");
4012
4013 if (more_than_one)
4014 return command_fail_badparam(cmd, name, buffer, tok,
4015 "More than one channel with that peer");
4016
4017 return NULL;
4018}
4019
4020static struct command_result *json_sign_last_tx(struct command *cmd,
4021 const char *buffer,

Callers

nothing calls this directly

Calls 3

param_peerFunction · 0.85
peer_any_channel_bystateFunction · 0.70
command_fail_badparamFunction · 0.50

Tested by

no test coverage detected