Skip to content

Commit 9e6c33b

Browse files
committed
Merge pull request #6356
f0cba6f Delay initial pruning until after wallet init (Adam Weiss)
2 parents a2bf40d + f0cba6f commit 9e6c33b

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

src/init.cpp

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,15 +1278,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
12781278
mempool.ReadFeeEstimates(est_filein);
12791279
fFeeEstimatesInitialized = true;
12801280

1281-
// if prune mode, unset NODE_NETWORK and prune block files
1282-
if (fPruneMode) {
1283-
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
1284-
nLocalServices &= ~NODE_NETWORK;
1285-
if (!fReindex) {
1286-
PruneAndFlush();
1287-
}
1288-
}
1289-
12901281
// ********************************************************* Step 8: load wallet
12911282
#ifdef ENABLE_WALLET
12921283
if (fDisableWallet) {
@@ -1440,7 +1431,21 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
14401431
#else // ENABLE_WALLET
14411432
LogPrintf("No wallet support compiled in!\n");
14421433
#endif // !ENABLE_WALLET
1443-
// ********************************************************* Step 9: import blocks
1434+
1435+
// ********************************************************* Step 9: data directory maintenance
1436+
1437+
// if pruning, unset the service bit and perform the initial blockstore prune
1438+
// after any wallet rescanning has taken place.
1439+
if (fPruneMode) {
1440+
uiInterface.InitMessage(_("Pruning blockstore..."));
1441+
LogPrintf("Unsetting NODE_NETWORK on prune mode\n");
1442+
nLocalServices &= ~NODE_NETWORK;
1443+
if (!fReindex) {
1444+
PruneAndFlush();
1445+
}
1446+
}
1447+
1448+
// ********************************************************* Step 10: import blocks
14441449

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

1467-
// ********************************************************* Step 10: start node
1472+
// ********************************************************* Step 11: start node
14681473

14691474
if (!CheckDiskSpace())
14701475
return false;

0 commit comments

Comments
 (0)