Changeset View
Changeset View
Standalone View
Standalone View
src/init.cpp
Show First 20 Lines • Show All 2,110 Lines • ▼ Show 20 Lines | #endif | ||||
int64_t nStart = 0; | int64_t nStart = 0; | ||||
bool fLoaded = false; | bool fLoaded = false; | ||||
while (!fLoaded && !ShutdownRequested()) { | while (!fLoaded && !ShutdownRequested()) { | ||||
bool fReset = fReindex; | bool fReset = fReindex; | ||||
std::string strLoadError; | std::string strLoadError; | ||||
uiInterface.InitMessage(_("Loading block index...")); | uiInterface.InitMessage(_("Loading block index...")); | ||||
LOCK(cs_main); | |||||
nStart = GetTimeMillis(); | nStart = GetTimeMillis(); | ||||
do { | do { | ||||
try { | try { | ||||
LOCK(cs_main); | |||||
UnloadBlockIndex(); | UnloadBlockIndex(); | ||||
pcoinsTip.reset(); | pcoinsTip.reset(); | ||||
pcoinsdbview.reset(); | pcoinsdbview.reset(); | ||||
pcoinscatcher.reset(); | pcoinscatcher.reset(); | ||||
pblocktree.reset( | pblocktree.reset( | ||||
new CBlockTreeDB(nBlockTreeDBCache, false, fReset)); | new CBlockTreeDB(nBlockTreeDBCache, false, fReset)); | ||||
if (fReset) { | if (fReset) { | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | while (!fLoaded && !ShutdownRequested()) { | ||||
if (!is_coinsview_empty) { | if (!is_coinsview_empty) { | ||||
// LoadChainTip sets chainActive based on pcoinsTip's best | // LoadChainTip sets chainActive based on pcoinsTip's best | ||||
// block | // block | ||||
if (!LoadChainTip(config)) { | if (!LoadChainTip(config)) { | ||||
strLoadError = _("Error initializing block database"); | strLoadError = _("Error initializing block database"); | ||||
break; | break; | ||||
} | } | ||||
assert(chainActive.Tip() != nullptr); | assert(chainActive.Tip() != nullptr); | ||||
} | |||||
if (!is_coinsview_empty) { | |||||
uiInterface.InitMessage(_("Verifying blocks...")); | uiInterface.InitMessage(_("Verifying blocks...")); | ||||
if (fHavePruned && | if (fHavePruned && | ||||
gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > | gArgs.GetArg("-checkblocks", DEFAULT_CHECKBLOCKS) > | ||||
MIN_BLOCKS_TO_KEEP) { | MIN_BLOCKS_TO_KEEP) { | ||||
LogPrintf( | LogPrintf( | ||||
"Prune: pruned datadir may not have more than %d " | "Prune: pruned datadir may not have more than %d " | ||||
"blocks; only checking available blocks\n", | "blocks; only checking available blocks\n", | ||||
MIN_BLOCKS_TO_KEEP); | MIN_BLOCKS_TO_KEEP); | ||||
▲ Show 20 Lines • Show All 249 Lines • Show Last 20 Lines |