@@ -404,7 +404,7 @@ std::string HelpMessage(HelpMessageMode mode)
404
404
strUsage += HelpMessageOpt (" -limitdescendantcount=<n>" , strprintf (" Do not accept transactions if any ancestor would have <n> or more in-mempool descendants (default: %u)" , DEFAULT_DESCENDANT_LIMIT));
405
405
strUsage += HelpMessageOpt (" -limitdescendantsize=<n>" , strprintf (" Do not accept transactions if any ancestor would have more than <n> kilobytes of in-mempool descendants (default: %u)." , DEFAULT_DESCENDANT_SIZE_LIMIT));
406
406
}
407
- string debugCategories = " addrman, alert, bench, coindb, db, lock, rand, rpc, selectcoins, mempool, mempoolrej, net, proxy, prune, http, libevent , tor, zmq" ; // Don't translate these and qt below
407
+ string debugCategories = " addrman, alert, bench, coindb, db, http, libevent, lock, mempool, mempoolrej, net, proxy, prune, rand, reindex, rpc, selectcoins , tor, zmq" ; // Don't translate these and qt below
408
408
if (mode == HMM_BITCOIN_QT)
409
409
debugCategories += " , qt" ;
410
410
strUsage += HelpMessageOpt (" -debug=<category>" , strprintf (_ (" Output debugging information (default: %u, supplying <category> is optional)" ), 0 ) + " . " +
@@ -554,9 +554,10 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
554
554
{
555
555
const CChainParams& chainparams = Params ();
556
556
RenameThread (" bitcoin-loadblk" );
557
+ CImportingNow imp;
558
+
557
559
// -reindex
558
560
if (fReindex ) {
559
- CImportingNow imp;
560
561
int nFile = 0 ;
561
562
while (true ) {
562
563
CDiskBlockPos pos (nFile, 0 );
@@ -581,7 +582,6 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
581
582
if (boost::filesystem::exists (pathBootstrap)) {
582
583
FILE *file = fopen (pathBootstrap.string ().c_str (), " rb" );
583
584
if (file) {
584
- CImportingNow imp;
585
585
boost::filesystem::path pathBootstrapOld = GetDataDir () / " bootstrap.dat.old" ;
586
586
LogPrintf (" Importing bootstrap.dat...\n " );
587
587
LoadExternalBlockFile (chainparams, file);
@@ -595,14 +595,20 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
595
595
BOOST_FOREACH (const boost::filesystem::path& path, vImportFiles) {
596
596
FILE *file = fopen (path.string ().c_str (), " rb" );
597
597
if (file) {
598
- CImportingNow imp;
599
598
LogPrintf (" Importing blocks file %s...\n " , path.string ());
600
599
LoadExternalBlockFile (chainparams, file);
601
600
} else {
602
601
LogPrintf (" Warning: Could not open blocks file %s\n " , path.string ());
603
602
}
604
603
}
605
604
605
+ // scan for better chains in the block chain database, that are not yet connected in the active best chain
606
+ CValidationState state;
607
+ if (!ActivateBestChain (state, chainparams)) {
608
+ LogPrintf (" Failed to connect best block" );
609
+ StartShutdown ();
610
+ }
611
+
606
612
if (GetBoolArg (" -stopafterblockimport" , DEFAULT_STOPAFTERBLOCKIMPORT)) {
607
613
LogPrintf (" Stopping after block import\n " );
608
614
StartShutdown ();
@@ -1358,12 +1364,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
1358
1364
if (mapArgs.count (" -blocknotify" ))
1359
1365
uiInterface.NotifyBlockTip .connect (BlockNotifyCallback);
1360
1366
1361
- uiInterface.InitMessage (_ (" Activating best chain..." ));
1362
- // scan for better chains in the block chain database, that are not yet connected in the active best chain
1363
- CValidationState state;
1364
- if (!ActivateBestChain (state, chainparams))
1365
- strErrors << " Failed to connect best block" ;
1366
-
1367
1367
std::vector<boost::filesystem::path> vImportFiles;
1368
1368
if (mapArgs.count (" -loadblock" ))
1369
1369
{
0 commit comments