aboutsummaryrefslogtreecommitdiff
path: root/src/interfaces/node.cpp
diff options
context:
space:
mode:
authorHennadii Stepanov <[email protected]>2020-03-27 20:29:20 +0200
committerHennadii Stepanov <[email protected]>2020-05-13 16:14:04 +0300
commitda73f1513a637a9f347b64de66564d6cdb2541f8 (patch)
tree80576a5b81b17858d82b11f2d0163c12303b13bd /src/interfaces/node.cpp
parentMerge #18814: rpc: Relock wallet only if most recent callback (diff)
downloaddiscoin-da73f1513a637a9f347b64de66564d6cdb2541f8.tar.xz
discoin-da73f1513a637a9f347b64de66564d6cdb2541f8.zip
qt: Fix shutdown when waitfor* cmds are called from RPC console
Diffstat (limited to 'src/interfaces/node.cpp')
-rw-r--r--src/interfaces/node.cpp10
1 files changed, 9 insertions, 1 deletions
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
{