Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,566 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). | ||||
if (!::BlockIndex().empty() && | if (!chainman.BlockIndex().empty() && | ||||
!LookupBlockIndex(params.hashGenesisBlock)) { | !LookupBlockIndex(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 | ||||
// is a user who has pruned blocks in the past, but is now | // is a user who has pruned blocks in the past, but is now | ||||
// trying to run unpruned. | // trying to run unpruned. | ||||
▲ Show 20 Lines • Show All 283 Lines • ▼ Show 20 Lines | #endif | ||||
// Step 12: start node | // Step 12: start node | ||||
int chain_active_height; | int chain_active_height; | ||||
//// debug print | //// debug print | ||||
{ | { | ||||
LOCK(cs_main); | LOCK(cs_main); | ||||
LogPrintf("block tree size = %u\n", ::BlockIndex().size()); | LogPrintf("block tree size = %u\n", chainman.BlockIndex().size()); | ||||
chain_active_height = ::ChainActive().Height(); | chain_active_height = chainman.ActiveChain().Height(); | ||||
} | } | ||||
LogPrintf("nBestHeight = %d\n", chain_active_height); | LogPrintf("nBestHeight = %d\n", chain_active_height); | ||||
if (args.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) { | if (args.GetBoolArg("-listenonion", DEFAULT_LISTEN_ONION)) { | ||||
StartTorControl(); | StartTorControl(); | ||||
} | } | ||||
Discover(); | Discover(); | ||||
▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines |