File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -453,8 +453,16 @@ void static BitcoinMiner(CWallet *pwallet)
453
453
if (chainparams.MiningRequiresPeers ()) {
454
454
// Busy-wait for the network to come online so we don't waste time mining
455
455
// on an obsolete chain. In regtest mode we expect to fly solo.
456
- while (vNodes.empty ())
456
+ do {
457
+ bool fvNodesEmpty;
458
+ {
459
+ LOCK (cs_vNodes);
460
+ fvNodesEmpty = vNodes.empty ();
461
+ }
462
+ if (!fvNodesEmpty && !IsInitialBlockDownload ())
463
+ break ;
457
464
MilliSleep (1000 );
465
+ } while (true );
458
466
}
459
467
460
468
//
@@ -533,6 +541,11 @@ void static BitcoinMiner(CWallet *pwallet)
533
541
LogPrintf (" BitcoinMiner terminated\n " );
534
542
throw ;
535
543
}
544
+ catch (const std::runtime_error &e)
545
+ {
546
+ LogPrintf (" BitcoinMiner runtime error: %s\n " , e.what ());
547
+ return ;
548
+ }
536
549
}
537
550
538
551
void GenerateBitcoins (bool fGenerate , CWallet* pwallet, int nThreads)
You can’t perform that action at this time.
0 commit comments