mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 12:32:48 +01:00
Acquire lock to check for genesis block.
This commit is contained in:
parent
b3e42b6d02
commit
46b0c3b688
14
src/init.cpp
14
src/init.cpp
@ -1371,10 +1371,18 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
|
|||||||
vImportFiles.push_back(strFile);
|
vImportFiles.push_back(strFile);
|
||||||
}
|
}
|
||||||
threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles));
|
threadGroup.create_thread(boost::bind(&ThreadImport, vImportFiles));
|
||||||
if (chainActive.Tip() == NULL) {
|
|
||||||
LogPrintf("Waiting for genesis block to be imported...\n");
|
// Wait for genesis block to be processed
|
||||||
while (!fRequestShutdown && chainActive.Tip() == NULL)
|
bool fHaveGenesis = false;
|
||||||
|
while (!fHaveGenesis && !fRequestShutdown) {
|
||||||
|
{
|
||||||
|
LOCK(cs_main);
|
||||||
|
fHaveGenesis = (chainActive.Tip() != NULL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!fHaveGenesis) {
|
||||||
MilliSleep(10);
|
MilliSleep(10);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ********************************************************* Step 11: start node
|
// ********************************************************* Step 11: start node
|
||||||
|
Loading…
Reference in New Issue
Block a user