From 4a85e067502a5df340e1b8c49df21e4c30a0de68 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Sun, 8 Dec 2013 15:26:08 +0100 Subject: 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. --- src/miner.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/miner.cpp') 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 -- cgit v1.2.3