| 3893 | } |
| 3894 | |
| 3895 | static struct command_result *json_dev_reenable_commit(struct command *cmd, |
| 3896 | const char *buffer, |
| 3897 | const jsmntok_t *obj UNNEEDED, |
| 3898 | const jsmntok_t *params) |
| 3899 | { |
| 3900 | u8 *msg; |
| 3901 | struct channel *channel; |
| 3902 | |
| 3903 | if (!param_check(cmd, buffer, params, |
| 3904 | p_req("id", param_dev_channel, &channel), |
| 3905 | NULL)) |
| 3906 | return command_param_failed(); |
| 3907 | |
| 3908 | if (!channel->owner) { |
| 3909 | return command_fail(cmd, LIGHTNINGD, |
| 3910 | "Peer has no owner"); |
| 3911 | } |
| 3912 | |
| 3913 | if (!streq(channel->owner->name, "channeld")) { |
| 3914 | return command_fail(cmd, LIGHTNINGD, |
| 3915 | "Peer owned by %s", channel->owner->name); |
| 3916 | } |
| 3917 | |
| 3918 | if (command_check_only(cmd)) |
| 3919 | return command_check_done(cmd); |
| 3920 | |
| 3921 | msg = towire_channeld_dev_reenable_commit(channel); |
| 3922 | subd_req(channel, channel->owner, take(msg), -1, 0, |
| 3923 | dev_reenable_commit_finished, cmd); |
| 3924 | return command_still_pending(cmd); |
| 3925 | } |
| 3926 | |
| 3927 | static const struct json_command dev_reenable_commit = { |
| 3928 | "dev-reenable-commit", |
nothing calls this directly
no test coverage detected