MCPcopy Create free account
hub / github.com/ElementsProject/lightning / json_dev_reenable_commit

Function json_dev_reenable_commit

lightningd/peer_control.c:4175–4205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4173}
4174
4175static 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
4207static const struct json_command dev_reenable_commit = {
4208 "dev-reenable-commit",

Callers

nothing calls this directly

Calls 8

param_checkFunction · 0.85
command_param_failedFunction · 0.70
command_failFunction · 0.70
command_check_onlyFunction · 0.70
command_check_doneFunction · 0.70
subd_reqClass · 0.70
command_still_pendingFunction · 0.70

Tested by

no test coverage detected