diff --git a/lightningd/notification.c b/lightningd/notification.c index a962ddc1c2c5..9d8072eb90ad 100644 --- a/lightningd/notification.c +++ b/lightningd/notification.c @@ -639,7 +639,7 @@ void notify_log(struct lightningd *ld, const struct log_entry *l) notify_send(ld, n); } -static void plugin_started_notification_serialize(struct json_stream *stream, +static void plugin_notification_serialize(struct json_stream *stream, struct plugin *plugin) { json_add_string(stream, "plugin_name", plugin->shortname); @@ -656,27 +656,15 @@ REGISTER_NOTIFICATION(plugin_started); void notify_plugin_started(struct lightningd *ld, struct plugin *plugin) { struct jsonrpc_notification *n = notify_start("plugin_started"); - plugin_started_notification_serialize(n->stream, plugin); + plugin_notification_serialize(n->stream, plugin); notify_send(ld, n); } -static void plugin_stopped_notification_serialize(struct json_stream *stream, - struct plugin *plugin) -{ - json_add_string(stream, "plugin_name", plugin->shortname); - json_add_string(stream, "plugin_path", plugin->cmd); - json_array_start(stream, "methods"); - for (size_t i = 0; i < tal_count(plugin->methods); i++) { - json_add_string(stream, NULL, plugin->methods[i]); - } - json_array_end(stream); -} - REGISTER_NOTIFICATION(plugin_stopped); void notify_plugin_stopped(struct lightningd *ld, struct plugin *plugin) { struct jsonrpc_notification *n = notify_start("plugin_stopped"); - plugin_stopped_notification_serialize(n->stream, plugin); + plugin_notification_serialize(n->stream, plugin); notify_send(ld, n); }