From a8db31c83d6a43e07f741f7f61b1bf0df87621c7 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Fri, 17 Jan 2014 16:32:35 +0100 Subject: qt: allow `walletpassphrase` in debug console without -server Currently it is only possible to use `walletpassphrase` to unlock the wallet when bitcoin is started in server mode. Almost everything that manipulates the wallet in the RPC console needs the wallet to be unlocked and is thus unusable without -server. This is pretty unintuitive to me, and I'm sure it's even more confusing to users. Solve this with a very minimal change: by making the GUI start a dummy RPC thread just to handle timeouts. --- src/qt/bitcoin.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/qt/bitcoin.cpp') diff --git a/src/qt/bitcoin.cpp b/src/qt/bitcoin.cpp index 3cf7e53c02..9b0b1d6e43 100644 --- a/src/qt/bitcoin.cpp +++ b/src/qt/bitcoin.cpp @@ -21,6 +21,7 @@ #include "init.h" #include "main.h" +#include "rpcserver.h" #include "ui_interface.h" #include "util.h" #include "wallet.h" @@ -227,6 +228,13 @@ void BitcoinCore::initialize() { LogPrintf("Running AppInit2 in thread\n"); int rv = AppInit2(threadGroup); + if(rv) + { + /* Start a dummy RPC thread if no RPC thread is active yet + * to handle timeouts. + */ + StartDummyRPCThread(); + } emit initializeResult(rv); } catch (std::exception& e) { handleRunawayException(&e); -- cgit v1.2.3