@@ -958,7 +958,6 @@ bool AppInit2()
958958 else if (nScriptCheckThreads > MAX_SCRIPTCHECK_THREADS)
959959 nScriptCheckThreads = MAX_SCRIPTCHECK_THREADS;
960960
961- fServer = GetBoolArg (" -server" , false );
962961 setvbuf (stdout, NULL , _IOLBF, 0 ); // / ***TODO*** do we still need this after -printtoconsole is gone?
963962
964963 // Staking needs a CWallet instance, so make sure wallet is enabled
@@ -1114,14 +1113,12 @@ bool AppInit2()
11141113 * that the server is there and will be ready later). Warmup mode will
11151114 * be disabled when initialisation is finished.
11161115 */
1117- if (fServer ) {
1116+ if (GetBoolArg ( " -server " , false ) ) {
11181117 uiInterface.InitMessage .connect (SetRPCWarmupStatus);
11191118 if (!AppInitServers ())
11201119 return InitError (_ (" Unable to start HTTP server. See debug log for details." ));
11211120 }
11221121
1123- int64_t nStart;
1124-
11251122// ********************************************************* Step 5: Backup wallet and verify wallet database integrity
11261123#ifdef ENABLE_WALLET
11271124 if (!fDisableWallet ) {
@@ -1443,8 +1440,9 @@ bool AppInit2()
14431440
14441441 uiInterface.InitMessage (_ (" Loading block index..." ));
14451442
1446- nStart = GetTimeMillis ();
14471443 do {
1444+ const int64_t load_block_index_start_time = GetTimeMillis ();
1445+
14481446 try {
14491447 UnloadBlockIndex ();
14501448 delete pcoinsTip;
@@ -1615,6 +1613,7 @@ bool AppInit2()
16151613
16161614 fVerifyingBlocks = false ;
16171615 fLoaded = true ;
1616+ LogPrintf (" block index %15dms\n " , GetTimeMillis () - load_block_index_start_time);
16181617 } while (false );
16191618
16201619 if (!fLoaded && !ShutdownRequested ()) {
@@ -1643,7 +1642,6 @@ bool AppInit2()
16431642 LogPrintf (" Shutdown requested. Exiting.\n " );
16441643 return false ;
16451644 }
1646- LogPrintf (" block index %15dms\n " , GetTimeMillis () - nStart);
16471645
16481646 boost::filesystem::path est_path = GetDataDir () / FEE_ESTIMATES_FILENAME;
16491647 CAutoFile est_filein (fopen (est_path.string ().c_str (), " rb" ), SER_DISK, CLIENT_VERSION);
@@ -1679,7 +1677,7 @@ bool AppInit2()
16791677 uiInterface.InitMessage (_ (" Loading wallet..." ));
16801678 fVerifyingBlocks = true ;
16811679
1682- nStart = GetTimeMillis ();
1680+ const int64_t nWalletStartTime = GetTimeMillis ();
16831681 bool fFirstRun = true ;
16841682 pwalletMain = new CWallet (strWalletFile);
16851683 DBErrors nLoadWalletRet = pwalletMain->LoadWallet (fFirstRun );
@@ -1727,7 +1725,7 @@ bool AppInit2()
17271725 }
17281726
17291727 LogPrintf (" %s" , strErrors.str ());
1730- LogPrintf (" wallet %15dms\n " , GetTimeMillis () - nStart );
1728+ LogPrintf (" Wallet completed loading in %15dms\n " , GetTimeMillis () - nWalletStartTime );
17311729 zwalletMain = new CzPIVWallet (pwalletMain->strWalletFile );
17321730 pwalletMain->setZWallet (zwalletMain);
17331731
@@ -1747,9 +1745,9 @@ bool AppInit2()
17471745 if (chainActive.Tip () && chainActive.Tip () != pindexRescan) {
17481746 uiInterface.InitMessage (_ (" Rescanning..." ));
17491747 LogPrintf (" Rescanning last %i blocks (from block %i)...\n " , chainActive.Height () - pindexRescan->nHeight , pindexRescan->nHeight );
1750- nStart = GetTimeMillis ();
1748+ const int64_t nWalletRescanTime = GetTimeMillis ();
17511749 pwalletMain->ScanForWalletTransactions (pindexRescan, true );
1752- LogPrintf (" rescan %15dms\n " , GetTimeMillis () - nStart );
1750+ LogPrintf (" Rescan completed in %15dms\n " , GetTimeMillis () - nWalletRescanTime );
17531751 pwalletMain->SetBestChain (chainActive.GetLocator ());
17541752 nWalletDBUpdated++;
17551753
0 commit comments