aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-05-30 15:51:41 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2013-05-30 16:41:35 +0200
commitd98bf10f23e0e633ff2ff33075a353d30bf862b4 (patch)
tree0bc8873a2c74894989dcf9dfe3b8f69696d5814b /src/init.cpp
parentba35ecc003d148527f30b4df84285add072fae90 (diff)
Move pMiningKey init out of StartRPCThreads
This commit decouples the pMiningKey initialization and shutdown from the RPC threads. `getwork` and `getblocktemplate` rely on pMiningKey, and can also be ran from the debug window in the UI even when the RPC server is not running. Solves issue #2706.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 767d7525a6..9c807b288e 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -96,6 +96,7 @@ void Shutdown()
RenameThread("bitcoin-shutoff");
nTransactionsUpdated++;
StopRPCThreads();
+ ShutdownRPCMining();
bitdb.Flush(false);
StopNode();
{
@@ -1081,6 +1082,8 @@ bool AppInit2(boost::thread_group& threadGroup)
StartNode(threadGroup);
+ // InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly.
+ InitRPCMining();
if (fServer)
StartRPCThreads();