mirror of
https://github.com/twisterarmy/twister-core.git
synced 2025-01-09 14:28:22 +00:00
Merge pull request #2716 from laanwj/2013_05_30_getwork
Move pMiningKey init out of StartRPCThreads
This commit is contained in:
commit
6bc6d57303
@ -30,10 +30,6 @@ using namespace boost;
|
|||||||
using namespace boost::asio;
|
using namespace boost::asio;
|
||||||
using namespace json_spirit;
|
using namespace json_spirit;
|
||||||
|
|
||||||
// Key used by getwork/getblocktemplate miners.
|
|
||||||
// Allocated in StartRPCThreads, free'd in StopRPCThreads
|
|
||||||
CReserveKey* pMiningKey = NULL;
|
|
||||||
|
|
||||||
static std::string strRPCUserColonPass;
|
static std::string strRPCUserColonPass;
|
||||||
|
|
||||||
// These are created by StartRPCThreads, destroyed in StopRPCThreads
|
// These are created by StartRPCThreads, destroyed in StopRPCThreads
|
||||||
@ -727,9 +723,6 @@ static void RPCAcceptHandler(boost::shared_ptr< basic_socket_acceptor<Protocol,
|
|||||||
|
|
||||||
void StartRPCThreads()
|
void StartRPCThreads()
|
||||||
{
|
{
|
||||||
// getwork/getblocktemplate mining rewards paid here:
|
|
||||||
pMiningKey = new CReserveKey(pwalletMain);
|
|
||||||
|
|
||||||
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
|
strRPCUserColonPass = mapArgs["-rpcuser"] + ":" + mapArgs["-rpcpassword"];
|
||||||
if ((mapArgs["-rpcpassword"] == "") ||
|
if ((mapArgs["-rpcpassword"] == "") ||
|
||||||
(mapArgs["-rpcuser"] == mapArgs["-rpcpassword"]))
|
(mapArgs["-rpcuser"] == mapArgs["-rpcpassword"]))
|
||||||
@ -849,8 +842,6 @@ void StartRPCThreads()
|
|||||||
|
|
||||||
void StopRPCThreads()
|
void StopRPCThreads()
|
||||||
{
|
{
|
||||||
delete pMiningKey; pMiningKey = NULL;
|
|
||||||
|
|
||||||
if (rpc_io_service == NULL) return;
|
if (rpc_io_service == NULL) return;
|
||||||
|
|
||||||
deadlineTimers.clear();
|
deadlineTimers.clear();
|
||||||
|
@ -129,7 +129,9 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
extern const CRPCTable tableRPC;
|
extern const CRPCTable tableRPC;
|
||||||
extern CReserveKey* pMiningKey;
|
|
||||||
|
extern void InitRPCMining();
|
||||||
|
extern void ShutdownRPCMining();
|
||||||
|
|
||||||
extern int64 nWalletUnlockTime;
|
extern int64 nWalletUnlockTime;
|
||||||
extern int64 AmountFromValue(const json_spirit::Value& value);
|
extern int64 AmountFromValue(const json_spirit::Value& value);
|
||||||
|
@ -97,6 +97,7 @@ void Shutdown()
|
|||||||
RenameThread("bitcoin-shutoff");
|
RenameThread("bitcoin-shutoff");
|
||||||
nTransactionsUpdated++;
|
nTransactionsUpdated++;
|
||||||
StopRPCThreads();
|
StopRPCThreads();
|
||||||
|
ShutdownRPCMining();
|
||||||
bitdb.Flush(false);
|
bitdb.Flush(false);
|
||||||
StopNode();
|
StopNode();
|
||||||
{
|
{
|
||||||
@ -1088,6 +1089,8 @@ bool AppInit2(boost::thread_group& threadGroup)
|
|||||||
|
|
||||||
StartNode(threadGroup);
|
StartNode(threadGroup);
|
||||||
|
|
||||||
|
// InitRPCMining is needed here so getwork/getblocktemplate in the GUI debug console works properly.
|
||||||
|
InitRPCMining();
|
||||||
if (fServer)
|
if (fServer)
|
||||||
StartRPCThreads();
|
StartRPCThreads();
|
||||||
|
|
||||||
|
@ -11,6 +11,21 @@
|
|||||||
using namespace json_spirit;
|
using namespace json_spirit;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
// Key used by getwork/getblocktemplate miners.
|
||||||
|
// Allocated in InitRPCMining, free'd in ShutdownRPCMining
|
||||||
|
static CReserveKey* pMiningKey = NULL;
|
||||||
|
|
||||||
|
void InitRPCMining()
|
||||||
|
{
|
||||||
|
// getwork/getblocktemplate mining rewards paid here:
|
||||||
|
pMiningKey = new CReserveKey(pwalletMain);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ShutdownRPCMining()
|
||||||
|
{
|
||||||
|
delete pMiningKey; pMiningKey = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
Value getgenerate(const Array& params, bool fHelp)
|
Value getgenerate(const Array& params, bool fHelp)
|
||||||
{
|
{
|
||||||
if (fHelp || params.size() != 0)
|
if (fHelp || params.size() != 0)
|
||||||
|
Loading…
Reference in New Issue
Block a user