Skip to content

Commit

Permalink
Merge pull request #6356
Browse files Browse the repository at this point in the history
f0cba6f Delay initial pruning until after wallet init (Adam Weiss)
  • Loading branch information
laanwj committed Aug 3, 2015
2 parents a2bf40d + f0cba6f commit 9e6c33b
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1278,15 +1278,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
mempool.ReadFeeEstimates(est_filein);
fFeeEstimatesInitialized = true;

// if prune mode, unset NODE_NETWORK and prune block files
if (fPruneMode) {
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
nLocalServices &= ~NODE_NETWORK;
if (!fReindex) {
PruneAndFlush();
}
}

// ********************************************************* Step 8: load wallet
#ifdef ENABLE_WALLET
if (fDisableWallet) {
Expand Down Expand Up @@ -1440,7 +1431,21 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
#else // ENABLE_WALLET
LogPrintf("No wallet support compiled in!\n");
#endif // !ENABLE_WALLET
// ********************************************************* Step 9: import blocks

// ********************************************************* Step 9: data directory maintenance

// if pruning, unset the service bit and perform the initial blockstore prune
// after any wallet rescanning has taken place.
if (fPruneMode) {
uiInterface.InitMessage(_("Pruning blockstore..."));
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
nLocalServices &= ~NODE_NETWORK;
if (!fReindex) {
PruneAndFlush();
}
}

// ********************************************************* Step 10: import blocks

if (mapArgs.count("-blocknotify"))
uiInterface.NotifyBlockTip.connect(BlockNotifyCallback);
Expand All @@ -1464,7 +1469,7 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
MilliSleep(10);
}

// ********************************************************* Step 10: start node
// ********************************************************* Step 11: start node

if (!CheckDiskSpace())
return false;
Expand Down

0 comments on commit 9e6c33b

Please sign in to comment.