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

Function param_dev_channel

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

3783
3784/* dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */
3785static struct command_result *param_dev_channel(struct command *cmd,
3786 const char *name,
3787 const char *buffer,
3788 const jsmntok_t *tok,
3789 struct channel **channel)
3790{
3791 struct peer *peer COMPILER_WANTS_INIT("gcc version 12.3.0 -O3");
3792 struct command_result *res;
3793 bool more_than_one;
3794
3795 res = param_peer(cmd, name, buffer, tok, &peer);
3796 if (res)
3797 return res;
3798
3799 *channel = peer_any_channel_bystate(peer, channel_state_wants_peercomms,
3800 &more_than_one);
3801 if (!*channel)
3802 return command_fail_badparam(cmd, name, buffer, tok,
3803 "No channel with that peer");
3804
3805 if (more_than_one)
3806 return command_fail_badparam(cmd, name, buffer, tok,
3807 "More than one channel with that peer");
3808
3809 return NULL;
3810}
3811
3812static struct command_result *json_sign_last_tx(struct command *cmd,
3813 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