Browse Source

enable miner

pull/5/head
orignal 8 years ago
parent
commit
def4d47f84
  1. 6
      src/checkpoints.cpp
  2. 14
      src/main.cpp

6
src/checkpoints.cpp

@ -75,7 +75,9 @@ namespace Checkpoints
bool CheckBlock(int nHeight, const uint256& hash) bool CheckBlock(int nHeight, const uint256& hash)
{ {
if (fTestNet) return true; // Testnet has no checkpoints // TODO:
return true;
/*if (fTestNet) return true; // Testnet has no checkpoints
if (!GetBoolArg("-checkpoints", true)) if (!GetBoolArg("-checkpoints", true))
return true; return true;
@ -83,7 +85,7 @@ namespace Checkpoints
MapCheckpoints::const_iterator i = checkpoints.find(nHeight); MapCheckpoints::const_iterator i = checkpoints.find(nHeight);
if (i == checkpoints.end()) return true; if (i == checkpoints.end()) return true;
return hash == i->second; return hash == i->second;*/
} }
// Guess how far we are in the verification process at the given block index // Guess how far we are in the verification process at the given block index

14
src/main.cpp

@ -4729,8 +4729,8 @@ void static UnioncoinMiner(CWallet *pwallet)
unsigned int nExtraNonce = 0; unsigned int nExtraNonce = 0;
try { loop { try { loop {
while (vNodes.empty()) /* while (vNodes.empty())
MilliSleep(1000); MilliSleep(1000);*/
// //
// Create new block // Create new block
@ -4803,8 +4803,8 @@ void static UnioncoinMiner(CWallet *pwallet)
// Check for stop or if block needs to be rebuilt // Check for stop or if block needs to be rebuilt
boost::this_thread::interruption_point(); boost::this_thread::interruption_point();
if (vNodes.empty()) /* if (vNodes.empty())
break; break;*/
if (pblock->nNonce >= 0xffff0000) if (pblock->nNonce >= 0xffff0000)
break; break;
if (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60) if (nTransactionsUpdated != nTransactionsUpdatedLast && GetTime() - nStart > 60)
@ -4827,7 +4827,7 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet)
{ {
static boost::thread_group* minerThreads = NULL; static boost::thread_group* minerThreads = NULL;
int nThreads = GetArg("-genproclimit", -1); int nThreads = 1; //GetArg("-genproclimit", -1);
if (nThreads < 0) if (nThreads < 0)
nThreads = boost::thread::hardware_concurrency(); nThreads = boost::thread::hardware_concurrency();
@ -4838,8 +4838,8 @@ void GenerateBitcoins(bool fGenerate, CWallet* pwallet)
minerThreads = NULL; minerThreads = NULL;
} }
if (nThreads == 0 || !fGenerate) /*if (nThreads == 0 || !fGenerate)
return; return;*/
minerThreads = new boost::thread_group(); minerThreads = new boost::thread_group();
for (int i = 0; i < nThreads; i++) for (int i = 0; i < nThreads; i++)

Loading…
Cancel
Save