| 4173 | } |
| 4174 | |
| 4175 | static struct command_result *json_dev_reenable_commit(struct command *cmd, |
| 4176 | const char *buffer, |
| 4177 | const jsmntok_t *obj UNNEEDED, |
| 4178 | const jsmntok_t *params) |
| 4179 | { |
| 4180 | u8 *msg; |
| 4181 | struct channel *channel; |
| 4182 | |
| 4183 | if (!param_check(cmd, buffer, params, |
| 4184 | p_req("id", param_dev_channel, &channel), |
| 4185 | NULL)) |
| 4186 | return command_param_failed(); |
| 4187 | |
| 4188 | if (!channel->owner) { |
| 4189 | return command_fail(cmd, LIGHTNINGD, |
| 4190 | "Peer has no owner"); |
| 4191 | } |
| 4192 | |
| 4193 | if (!streq(channel->owner->name, "channeld")) { |
| 4194 | return command_fail(cmd, LIGHTNINGD, |
| 4195 | "Peer owned by %s", channel->owner->name); |
| 4196 | } |
| 4197 | |
| 4198 | if (command_check_only(cmd)) |
| 4199 | return command_check_done(cmd); |
| 4200 | |
| 4201 | msg = towire_channeld_dev_reenable_commit(channel); |
| 4202 | subd_req(channel, channel->owner, take(msg), -1, 0, |
| 4203 | dev_reenable_commit_finished, cmd); |
| 4204 | return command_still_pending(cmd); |
| 4205 | } |
| 4206 | |
| 4207 | static const struct json_command dev_reenable_commit = { |
| 4208 | "dev-reenable-commit", |
nothing calls this directly
no test coverage detected