diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-08-03 19:24:12 +0200 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2015-08-03 19:34:50 +0200 |
commit | 9e6c33b202b43cf98fc3a5d400cd43ff27b14d66 (patch) | |
tree | a21803e2634f372bafb105138d3bb0a4416d3167 | |
parent | a2bf40dde7465292a29234c6d32d9df7e386617e (diff) | |
parent | f0cba6f8ebc2eb5a988f506b37e7113f724e63ff (diff) | |
download | bitcoin-9e6c33b202b43cf98fc3a5d400cd43ff27b14d66.tar.xz |
Merge pull request #6356
f0cba6f Delay initial pruning until after wallet init (Adam Weiss)
-rw-r--r-- | src/init.cpp | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/src/init.cpp b/src/init.cpp index a03571c31a..6bea42a20e 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -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) { @@ -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); @@ -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; |