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

Function json_dev_reenable_commit

lightningd/peer_control.c:3895–3925  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3893}
3894
3895static 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
3927static const struct json_command dev_reenable_commit = {
3928 "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