diff --git a/plugins/libplugin.c b/plugins/libplugin.c index fc05f72f8d30..abd3336d5479 100644 --- a/plugins/libplugin.c +++ b/plugins/libplugin.c @@ -590,7 +590,9 @@ handle_getmanifest(struct command *getmanifest_cmd, struct json_stream *params = jsonrpc_stream_success(getmanifest_cmd); struct plugin *p = getmanifest_cmd->plugin; const jsmntok_t *dep; +#if DEVELOPER bool has_shutdown_notif; +#endif /* This was added post 0.9.0 */ dep = json_get_member(buf, getmanifest_params, "allow-deprecated-apis"); @@ -630,13 +632,13 @@ handle_getmanifest(struct command *getmanifest_cmd, json_array_end(params); json_array_start(params, "subscriptions"); +#if DEVELOPER has_shutdown_notif = false; for (size_t i = 0; i < p->num_notif_subs; i++) { json_add_string(params, NULL, p->notif_subs[i].name); if (streq(p->notif_subs[i].name, "shutdown")) has_shutdown_notif = true; } -#if DEVELOPER /* For memleak detection, always get notified of shutdown. */ if (!has_shutdown_notif) json_add_string(params, NULL, "shutdown");