From da73f1513a637a9f347b64de66564d6cdb2541f8 Mon Sep 17 00:00:00 2001 From: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> Date: Fri, 27 Mar 2020 20:29:20 +0200 Subject: qt: Fix shutdown when waitfor* cmds are called from RPC console --- src/interfaces/node.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/interfaces/node.cpp') diff --git a/src/interfaces/node.cpp b/src/interfaces/node.cpp index 9e603a12c..91ed1dc72 100644 --- a/src/interfaces/node.cpp +++ b/src/interfaces/node.cpp @@ -87,7 +87,15 @@ public: Interrupt(m_context); Shutdown(m_context); } - void startShutdown() override { StartShutdown(); } + void startShutdown() override + { + StartShutdown(); + // Stop RPC for clean shutdown if any of waitfor* commands is executed. + if (gArgs.GetBoolArg("-server", false)) { + InterruptRPC(); + StopRPC(); + } + } bool shutdownRequested() override { return ShutdownRequested(); } void mapPort(bool use_upnp) override { -- cgit v1.2.3