| 110 | } |
| 111 | |
| 112 | static struct command_result *plugin_stop(struct command *cmd, struct plugin *p, |
| 113 | bool kill) |
| 114 | { |
| 115 | struct json_stream *response; |
| 116 | const char *stopmsg = tal_fmt(NULL, "Successfully stopped %s.", |
| 117 | p->shortname); |
| 118 | |
| 119 | if (kill) |
| 120 | plugin_kill(p, LOG_INFORM, "stopped by lightningd via RPC"); |
| 121 | |
| 122 | response = json_stream_success(cmd); |
| 123 | json_add_string(response, "command", "stop"); |
| 124 | json_add_string(response, "result", take(stopmsg)); |
| 125 | return command_success(cmd, response); |
| 126 | } |
| 127 | |
| 128 | /* If plugin stops itself, we end up here. */ |
| 129 | static void plugin_stopped(struct plugin *p, struct command *cmd) |
no test coverage detected