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

Function param_dev_channel

lightningd/peer_control.c:4063–4088  ·  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

4061
4062/* dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */
4063static struct command_result *param_dev_channel(struct command *cmd,
4064 const char *name,
4065 const char *buffer,
4066 const jsmntok_t *tok,
4067 struct channel **channel)
4068{
4069 struct peer *peer COMPILER_WANTS_INIT(NULL, "gcc version 12.3.0 -O3");
4070 struct command_result *res;
4071 bool more_than_one;
4072
4073 res = param_peer(cmd, name, buffer, tok, &peer);
4074 if (res)
4075 return res;
4076
4077 *channel = peer_any_channel_bystate(peer, channel_state_wants_peercomms,
4078 &more_than_one);
4079 if (!*channel)
4080 return command_fail_badparam(cmd, name, buffer, tok,
4081 "No channel with that peer");
4082
4083 if (more_than_one)
4084 return command_fail_badparam(cmd, name, buffer, tok,
4085 "More than one channel with that peer");
4086
4087 return NULL;
4088}
4089
4090static struct command_result *json_sign_last_tx(struct command *cmd,
4091 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