Add DefaultMinerThreads chain parameter

This commit is contained in:
jtimon
2014-03-07 22:47:56 -08:00
parent bfa9a1a638
commit 2595b9ac23
3 changed files with 8 additions and 2 deletions

View File

@@ -652,8 +652,9 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet, int nThreads)
static boost::thread_group* minerThreads = NULL;
if (nThreads < 0) {
if (Params().NetworkID() == CChainParams::REGTEST)
nThreads = 1;
// In regtest threads defaults to 1
if (Params().DefaultMinerThreads())
nThreads = Params().DefaultMinerThreads();
else
nThreads = boost::thread::hardware_concurrency();
}