X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fminer.cpp;fp=src%2Fminer.cpp;h=aca0674e87d17e41d10eda64bb4612c5a48e4f0c;hp=0f04521bc5bba70e1ecd7f0d567e734b6ee2f133;hb=de7d6a3e988d664b52e1c4039e0bb7f04c9b8bac;hpb=ea4a5e1318276e5b148f2122e0057675c801129f diff --git a/src/miner.cpp b/src/miner.cpp index 0f04521..aca0674 100644 --- a/src/miner.cpp +++ b/src/miner.cpp @@ -520,6 +520,8 @@ void StakeMiner(CWallet *pwallet) // Make this thread recognisable as the mining thread RenameThread("novacoin-miner"); + bool fTrySync = true; + // Each thread has its own counter unsigned int nExtraNonce = 0; @@ -537,11 +539,23 @@ void StakeMiner(CWallet *pwallet) while (vNodes.empty() || IsInitialBlockDownload()) { + fTrySync = true; + Sleep(1000); if (fShutdown) return; } + if (fTrySync) + { + fTrySync = false; + if (vNodes.size() < 3 || nBestHeight < GetNumBlocksOfPeers()) + { + Sleep(1000); + continue; + } + } + // // Create new block //