diff options
| author | Pieter Wuille <[email protected]> | 2016-05-25 16:02:06 +0200 |
|---|---|---|
| committer | Pieter Wuille <[email protected]> | 2016-05-25 16:12:20 +0200 |
| commit | c49c825bd9f4764536b45df5a684d97173673fc7 (patch) | |
| tree | 490f54bb2eaeca742b455199394e9fb0525c7582 /src/init.cpp | |
| parent | Merge #8092: Correct small typo in extract_strings_qt.py (diff) | |
| parent | Acquire lock to check for genesis block. (diff) | |
| download | discoin-c49c825bd9f4764536b45df5a684d97173673fc7.tar.xz discoin-c49c825bd9f4764536b45df5a684d97173673fc7.zip | |
Merge #8063: Acquire lock to check for genesis block.
46b0c3b Acquire lock to check for genesis block. (Patrick Strateman)
Diffstat (limited to 'src/init.cpp')
| -rw-r--r-- | src/init.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/init.cpp b/src/init.cpp index 8688381ec..f95027410 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -1373,10 +1373,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler) vImportFiles.push_back(strFile); } threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles)); - if (chainActive.Tip() == NULL) { - LogPrintf("Waiting for genesis block to be imported...\n"); - while (!fRequestShutdown && chainActive.Tip() == NULL) + + // Wait for genesis block to be processed + bool fHaveGenesis = false; + while (!fHaveGenesis && !fRequestShutdown) { + { + LOCK(cs_main); + fHaveGenesis = (chainActive.Tip() != NULL); + } + + if (!fHaveGenesis) { MilliSleep(10); + } } // ********************************************************* Step 11: start node |