aboutsummaryrefslogtreecommitdiff
path: root/src/miner.cpp
diff options
context:
space:
mode:
authorjtimon <jtimon@monetize.io>2014-03-07 17:59:30 -0800
committerjtimon <jtimon@monetize.io>2014-06-04 13:29:35 +0200
commit1712adbe0b084b6907b82db350a51ab44f8c3117 (patch)
treee6cea138e14e955442f336d658d20ba499df5d35 /src/miner.cpp
parent358a61ee061f5cec53c62e8226872a2d02afdb0d (diff)
Add MiningRequiresPeers chain parameter
Diffstat (limited to 'src/miner.cpp')
-rw-r--r--src/miner.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/miner.cpp b/src/miner.cpp
index 94fc8e3888..3d46a0d83e 100644
--- a/src/miner.cpp
+++ b/src/miner.cpp
@@ -512,7 +512,7 @@ void static BitcoinMiner(CWallet *pwallet)
unsigned int nExtraNonce = 0;
try { while (true) {
- if (Params().NetworkID() != CChainParams::REGTEST) {
+ if (Params().MiningRequiresPeers()) {
// Busy-wait for the network to come online so we don't waste time mining
// on an obsolete chain. In regtest mode we expect to fly solo.
while (vNodes.empty())
@@ -620,7 +620,8 @@ void static BitcoinMiner(CWallet *pwallet)
// Check for stop or if block needs to be rebuilt
boost::this_thread::interruption_point();
- if (vNodes.empty() && Params().NetworkID() != CChainParams::REGTEST)
+ // Regtest mode doesn't require peers
+ if (vNodes.empty() && Params().MiningRequiresPeers())
break;
if (nBlockNonce >= 0xffff0000)
break;