Skip to content

Commit

Permalink
[squashme] remove ENABLE_WALLET ifdefs for the internal miner
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli committed May 19, 2015
1 parent 413a448 commit 82942dc
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 16 deletions.
10 changes: 3 additions & 7 deletions src/init.cpp
Expand Up @@ -153,8 +153,8 @@ void Shutdown()
#ifdef ENABLE_WALLET
if (pwalletMain)
pwalletMain->Flush(false);
GenerateBitcoins(false, 0, Params());
#endif
GenerateBitcoins(false, 0, Params());
StopNode();
UnregisterNodeSignals(GetNodeSignals());

Expand Down Expand Up @@ -362,8 +362,8 @@ std::string HelpMessage(HelpMessageMode mode)
debugCategories += ", qt";
strUsage += HelpMessageOpt("-debug=<category>", strprintf(_("Output debugging information (default: %u, supplying <category> is optional)"), 0) + ". " +
_("If <category> is not supplied, output all debugging information.") + _("<category> can be:") + " " + debugCategories + ".");
#ifdef ENABLE_WALLET
strUsage += HelpMessageOpt("-gen", strprintf(_("Generate coins (default: %u)"), 0));
#ifdef ENABLE_WALLET
strUsage += HelpMessageOpt("-genproclimit=<n>", strprintf(_("Set the number of threads for coin generation if enabled (-1 = all cores, default: %d)"), 1));
#endif
strUsage += HelpMessageOpt("-help-debug", _("Show all debugging options (usage: --help -help-debug)"));
Expand Down Expand Up @@ -1382,11 +1382,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)

StartNode(threadGroup, scheduler);

#ifdef ENABLE_WALLET
// Generate coins in the background
if (pwalletMain)
GenerateBitcoins(GetBoolArg("-gen", false), GetArg("-genproclimit", 1), Params());
#endif
GenerateBitcoins(GetBoolArg("-gen", false), GetArg("-genproclimit", 1), Params());

// ********************************************************* Step 11: finished

Expand Down
3 changes: 0 additions & 3 deletions src/miner.cpp
Expand Up @@ -358,7 +358,6 @@ void IncrementExtraNonce(CBlock* pblock, CBlockIndex* pindexPrev, unsigned int&
pblock->hashMerkleRoot = pblock->BuildMerkleTree();
}

#ifdef ENABLE_WALLET
//////////////////////////////////////////////////////////////////////////////
//
// Internal miner
Expand Down Expand Up @@ -561,5 +560,3 @@ void GenerateBitcoins(bool fGenerate, int nThreads, const CChainParams& chainpar
for (int i = 0; i < nThreads; i++)
minerThreads->create_thread(boost::bind(&BitcoinMiner, boost::cref(chainparams), coinbaseScript));
}

#endif // ENABLE_WALLET
4 changes: 0 additions & 4 deletions src/rpcmining.cpp
Expand Up @@ -90,7 +90,6 @@ Value getnetworkhashps(const Array& params, bool fHelp)
return GetNetworkHashPS(params.size() > 0 ? params[0].get_int() : 120, params.size() > 1 ? params[1].get_int() : -1);
}

#ifdef ENABLE_WALLET
Value getgenerate(const Array& params, bool fHelp)
{
if (fHelp || params.size() != 0)
Expand Down Expand Up @@ -172,7 +171,6 @@ Value generate(const Array& params, bool fHelp)
return blockHashes;
}


Value setgenerate(const Array& params, bool fHelp)
{
if (fHelp || params.size() < 1 || params.size() > 2)
Expand Down Expand Up @@ -216,8 +214,6 @@ Value setgenerate(const Array& params, bool fHelp)

return Value::null;
}
#endif


Value getmininginfo(const Array& params, bool fHelp)
{
Expand Down
2 changes: 0 additions & 2 deletions src/rpcserver.cpp
Expand Up @@ -305,12 +305,10 @@ static const CRPCCommand vRPCCommands[] =
{ "mining", "prioritisetransaction", &prioritisetransaction, true },
{ "mining", "submitblock", &submitblock, true },

#ifdef ENABLE_WALLET
/* Coin generation */
{ "generating", "getgenerate", &getgenerate, true },
{ "generating", "setgenerate", &setgenerate, true },
{ "generating", "generate", &generate, true },
#endif

/* Raw transactions */
{ "rawtransactions", "createrawtransaction", &createrawtransaction, true },
Expand Down

0 comments on commit 82942dc

Please sign in to comment.