dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */
| 3991 | |
| 3992 | /* dev hack, don't use for real interfaces, which have to handle channel ids, or multiple channels */ |
| 3993 | static 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 | |
| 4020 | static struct command_result *json_sign_last_tx(struct command *cmd, |
| 4021 | const char *buffer, |
nothing calls this directly
no test coverage detected