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