@@ -404,7 +404,7 @@ std::string HelpMessage(HelpMessageMode mode)
404404 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));
405405 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));
406406 }
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
408408 if (mode == HMM_BITCOIN_QT)
409409 debugCategories += " , qt" ;
410410 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)
554554{
555555 const CChainParams& chainparams = Params ();
556556 RenameThread (" bitcoin-loadblk" );
557+ CImportingNow imp;
558+
557559 // -reindex
558560 if (fReindex ) {
559- CImportingNow imp;
560561 int nFile = 0 ;
561562 while (true ) {
562563 CDiskBlockPos pos (nFile, 0 );
@@ -581,7 +582,6 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
581582 if (boost::filesystem::exists (pathBootstrap)) {
582583 FILE *file = fopen (pathBootstrap.string ().c_str (), " rb" );
583584 if (file) {
584- CImportingNow imp;
585585 boost::filesystem::path pathBootstrapOld = GetDataDir () / " bootstrap.dat.old" ;
586586 LogPrintf (" Importing bootstrap.dat...\n " );
587587 LoadExternalBlockFile (chainparams, file);
@@ -595,14 +595,20 @@ void ThreadImport(std::vector<boost::filesystem::path> vImportFiles)
595595 BOOST_FOREACH (const boost::filesystem::path& path, vImportFiles) {
596596 FILE *file = fopen (path.string ().c_str (), " rb" );
597597 if (file) {
598- CImportingNow imp;
599598 LogPrintf (" Importing blocks file %s...\n " , path.string ());
600599 LoadExternalBlockFile (chainparams, file);
601600 } else {
602601 LogPrintf (" Warning: Could not open blocks file %s\n " , path.string ());
603602 }
604603 }
605604
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+
606612 if (GetBoolArg (" -stopafterblockimport" , DEFAULT_STOPAFTERBLOCKIMPORT)) {
607613 LogPrintf (" Stopping after block import\n " );
608614 StartShutdown ();
@@ -1358,12 +1364,6 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
13581364 if (mapArgs.count (" -blocknotify" ))
13591365 uiInterface.NotifyBlockTip .connect (BlockNotifyCallback);
13601366
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-
13671367 std::vector<boost::filesystem::path> vImportFiles;
13681368 if (mapArgs.count (" -loadblock" ))
13691369 {
0 commit comments