From 4e111e0a8f8d1f9e00a9702b273a642be485af34 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Wed, 2 Oct 2013 11:19:10 -0400 Subject: [PATCH] Add -disablewallet option, to disable wallet support (and BDB) Conflicts: src/init.cpp Rebased-from: 5d4f3a1f0cbdf52257b41ea09d175c0018ad9434 --- src/init.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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