aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-12-08 15:26:08 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-12-09 08:44:57 +0100
commit4a85e067502a5df340e1b8c49df21e4c30a0de68 (patch)
treee036991e5f02c9d5017e9230cceace4433f1d297 /src/miner.cpp
parent70370ae502df8756f3a067a00ccd61b9fc819581 (diff)
downloadbitcoin-4a85e067502a5df340e1b8c49df21e4c30a0de68.tar.xz
Allow mining RPCs with --disable-wallet
The following mining-related RPC calls don't use the wallet: - getnetworkhashps - getmininginfo - getblocktemplate - submitblock Enable them when compiling with --disable-wallet.
Diffstat (limited to 'src/miner.cpp')
-rw-r--r--src/miner.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/miner.cpp b/src/miner.cpp
index ecc40ac708..384ebd27cf 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -10,8 +10,11 @@
#include "net.h"
#include "wallet.h"
+#ifdef ENABLE_WALLET
+// These globals are only used by the built-in miner
double dHashesPerSec = 0.0;
int64_t nHPSTimerStart = 0;
+#endif
//////////////////////////////////////////////////////////////////////////////
//
@@ -381,6 +384,7 @@ CBlockTemplate* CreateNewBlock(const CScript& scriptPubKeyIn)
return pblocktemplate.release();
}
+#ifdef ENABLE_WALLET
CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
{
CPubKey pubkey;
@@ -390,6 +394,7 @@ CBlockTemplate* CreateNewBlockWithKey(CReserveKey& reservekey)
CScript scriptPubKey = CScript() << pubkey << OP_CHECKSIG;
return CreateNewBlock(scriptPubKey);
}
+#endif
void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int& nExtraNonce)
{
@@ -454,7 +459,7 @@ void FormatHashBuffers(CBlock* pblock, char* pmidstate, char* pdata, char* phash
memcpy(phash1, &tmp.hash1, 64);
}
-
+#ifdef ENABLE_WALLET
bool CheckWork(CBlock* pblock, CWallet& wallet, CReserveKey& reservekey)
{
uint256 hash = pblock->GetHash();
@@ -665,5 +670,5 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads)
minerThreads->create_thread(boost::bind(&BitcoinMiner, pwallet));
}
-
+#endif