mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
Merge #8063: Acquire lock to check for genesis block.
46b0c3b
Acquire lock to check for genesis block. (Patrick Strateman)
This commit is contained in:
commit
c49c825bd9
14
src/init.cpp
14
src/init.cpp
@ -1373,11 +1373,19 @@ 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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user