diff --git a/plugins/libplugin.c b/plugins/libplugin.c index b522dbcaf..f28f5be72 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -345,21 +345,6 @@ command_success(struct command *cmd, const struct json_out *result) return command_complete(cmd, js); } -struct command_result *WARN_UNUSED_RESULT -command_success_str(struct command *cmd, const char *str) -{ - struct json_stream *js = jsonrpc_stream_start(cmd); - - if (str) - json_add_string(js, "result", str); - else { - /* Use an empty object if they don't want anything. */ - json_object_start(js, "result"); - json_object_end(js); - } - return command_complete(cmd, js); -} - struct command_result *command_done_err(struct command *cmd, errcode_t code, const char *errmsg, @@ -904,7 +889,7 @@ static struct command_result *handle_init(struct command *cmd, if (with_rpc) io_new_conn(p, p->rpc_conn->fd, rpc_conn_init, p); - return command_success_str(cmd, NULL); + return command_success(cmd, json_out_obj(cmd, NULL, NULL)); } char *u64_option(const char *arg, u64 *i) diff --git a/plugins/libplugin.h b/plugins/libplugin.h index a70fa8078..6ae600fd9 100644 --- a/plugins/libplugin.h +++ b/plugins/libplugin.h @@ -181,11 +181,6 @@ struct command_result *command_err_raw(struct command *cmd, struct command_result *WARN_UNUSED_RESULT command_success(struct command *cmd, const struct json_out *result); -/* Simple version where we just want to send a string, or NULL means an empty - * result object. @cmd cannot be NULL. */ -struct command_result *WARN_UNUSED_RESULT -command_success_str(struct command *cmd, const char *str); - /* End a hook normally (with "result": "continue") */ struct command_result *WARN_UNUSED_RESULT command_hook_success(struct command *cmd);