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