diff --git a/src/init.cpp b/src/init.cpp index 55d33eedda..c984dc83e9 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -611,6 +611,7 @@ bool AppInit2(boost::thread_group& threadGroup) fPrintToConsole = GetBoolArg("-printtoconsole"); fPrintToDebugger = GetBoolArg("-printtodebugger"); fLogTimestamps = GetBoolArg("-logtimestamps", true); + bool fDisableWallet = GetBoolArg("-disablewallet", false); if (mapArgs.count("-timeout")) { @@ -699,7 +700,7 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 5: verify wallet database integrity - if (1) { + if (!fDisableWallet) { uiInterface.InitMessage(_("Verifying wallet...")); if (!bitdb.Open(GetDataDir())) @@ -743,7 +744,7 @@ bool AppInit2(boost::thread_group& threadGroup) if (r == CDBEnv::RECOVER_FAIL) return InitError(_("wallet.dat corrupt, salvage failed")); } - } // (1) + } // (!fDisableWallet) // ********************************************************* Step 6: network initialization @@ -1007,7 +1008,10 @@ bool AppInit2(boost::thread_group& threadGroup) // ********************************************************* Step 8: load wallet - if (1) { + if (fDisableWallet) { + printf("Wallet disabled!\n"); + pwalletMain = NULL; + } else { uiInterface.InitMessage(_("Loading wallet...")); nStart = GetTimeMillis(); @@ -1094,7 +1098,7 @@ bool AppInit2(boost::thread_group& threadGroup) pwalletMain->SetBestChain(CBlockLocator(pindexBest)); nWalletDBUpdated++; } - } // (1) + } // (!fDisableWallet) // ********************************************************* Step 9: import blocks