aboutsummaryrefslogtreecommitdiff
path: root/src/rpcmining.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpcmining.cpp')
-rw-r--r--src/rpcmining.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/rpcmining.cpp b/src/rpcmining.cpp
index b8b7459634..845e7f1f9c 100644
--- a/src/rpcmining.cpp
+++ b/src/rpcmining.cpp
@@ -11,6 +11,21 @@
using namespace json_spirit;
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)
{
if (fHelp || params.size() != 0)