From 209614677adbc3494cf3c63aa3fd6919b558e154 Mon Sep 17 00:00:00 2001 From: Simon Vrouwe Date: Wed, 10 Nov 2021 11:08:14 +0200 Subject: [PATCH] JSON RPC: In the shutdown loop, ignore plugin responses to JSON RPC requests --- lightningd/plugin.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lightningd/plugin.c b/lightningd/plugin.c index c0f3582b3..62f3a8e5f 100644 --- a/lightningd/plugin.c +++ b/lightningd/plugin.c @@ -520,6 +520,11 @@ static const char *plugin_response_handle(struct plugin *plugin, "Received a JSON-RPC response for non-existent request"); } + /* Ignore responses when shutting down */ + if (plugin->plugins->ld->state == LD_STATE_SHUTDOWN) { + return NULL; + } + /* We expect the request->cb to copy if needed */ pd = plugin_detect_destruction(plugin); request->response_cb(plugin->buffer, toks, idtok, request->response_cb_arg);