diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-05-30 15:51:41 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-05-30 16:41:35 +0200 |
commit | d98bf10f23e0e633ff2ff33075a353d30bf862b4 (patch) | |
tree | 0bc8873a2c74894989dcf9dfe3b8f69696d5814b /src/bitcoinrpc.cpp | |
parent | ba35ecc003d148527f30b4df84285add072fae90 (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/bitcoinrpc.cpp')
-rw-r--r-- | src/bitcoinrpc.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/src/bitcoinrpc.cpp b/src/bitcoinrpc.cpp index 2c4744a579..a9b73fd5a6 100644 --- a/src/bitcoinrpc.cpp +++ b/src/bitcoinrpc.cpp @@ -30,10 +30,6 @@ using namespace boost; using namespace boost::asio; using namespace json_spirit; -// Key used by getwork/getblocktemplate miners. -// Allocated in StartRPCThreads, free'd in StopRPCThreads -CReserveKey* pMiningKey = NULL; - static std::string strRPCUserColonPass; // These are created by StartRPCThreads, destroyed in StopRPCThreads @@ -726,9 +722,6 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol, void StartRPCThreads() { - // getwork/getblocktemplate mining rewards paid here: - pMiningKey = new CReserveKey(pwalletMain); - strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"]; if ((mapArgs["-rpcpassword"] == "") || (mapArgs["-rpcuser"] == mapArgs["-rpcpassword"])) @@ -848,8 +841,6 @@ void StartRPCThreads() void StopRPCThreads() { - delete pMiningKey; pMiningKey = NULL; - if (rpc_io_service == NULL) return; rpc_io_service->stop(); |