Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,698 Lines • ▼ Show 20 Lines | while (!fLoaded && !ShutdownRequested()) { | ||||
} | } | ||||
strLoadError = _("Error loading block database"); | strLoadError = _("Error loading block database"); | ||||
break; | break; | ||||
} | } | ||||
// If the loaded chain has a wrong genesis, bail out immediately | // If the loaded chain has a wrong genesis, bail out immediately | ||||
// (we're likely using a testnet datadir, or the other way | // (we're likely using a testnet datadir, or the other way | ||||
// around). | // around). | ||||
assert(std::addressof(g_chainman.m_blockman) == | |||||
std::addressof(chainman.m_blockman)); | |||||
if (!chainman.BlockIndex().empty() && | if (!chainman.BlockIndex().empty() && | ||||
!chainman.m_blockman.LookupBlockIndex( | !chainman.m_blockman.LookupBlockIndex( | ||||
params.hashGenesisBlock)) { | params.hashGenesisBlock)) { | ||||
return InitError(_("Incorrect or no genesis block found. " | return InitError(_("Incorrect or no genesis block found. " | ||||
"Wrong datadir for network?")); | "Wrong datadir for network?")); | ||||
} | } | ||||
// Check for changed -prune state. What we are concerned about | // Check for changed -prune state. What we are concerned about | ||||
▲ Show 20 Lines • Show All 223 Lines • ▼ Show 20 Lines | if (!CheckDiskSpace(gArgs.GetBlocksDirPath())) { | ||||
fs::quoted(fs::PathToString(gArgs.GetBlocksDirPath())))); | fs::quoted(fs::PathToString(gArgs.GetBlocksDirPath())))); | ||||
return false; | return false; | ||||
} | } | ||||
// Either install a handler to notify us when genesis activates, or set | // Either install a handler to notify us when genesis activates, or set | ||||
// fHaveGenesis directly. | // fHaveGenesis directly. | ||||
// No locking, as this happens before any background thread is started. | // No locking, as this happens before any background thread is started. | ||||
boost::signals2::connection block_notify_genesis_wait_connection; | boost::signals2::connection block_notify_genesis_wait_connection; | ||||
assert(std::addressof(::ChainActive()) == | |||||
std::addressof(chainman.ActiveChain())); | |||||
if (chainman.ActiveTip() == nullptr) { | if (chainman.ActiveTip() == nullptr) { | ||||
block_notify_genesis_wait_connection = | block_notify_genesis_wait_connection = | ||||
uiInterface.NotifyBlockTip_connect( | uiInterface.NotifyBlockTip_connect( | ||||
std::bind(BlockNotifyGenesisWait, std::placeholders::_2)); | std::bind(BlockNotifyGenesisWait, std::placeholders::_2)); | ||||
} else { | } else { | ||||
fHaveGenesis = true; | fHaveGenesis = true; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 229 Lines • Show Last 20 Lines |