diff options
author | Jeff Garzik <jgarzik@bitpay.com> | 2013-10-02 11:19:10 -0400 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-11-13 09:22:00 +0100 |
commit | e6b7e3dc79e91db7a9e20ec8fd593145f6c3ac41 (patch) | |
tree | 662fe2ffe9cfd85fb3e57549437cdb889c254fea /src | |
parent | f9ee7a032b14e5c78ef11446458156680fccf858 (diff) |
Add -disablewallet option, to disable wallet support (and BDB)
Diffstat (limited to 'src')
-rw-r--r-- | src/init.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/init.cpp b/src/init.cpp index 19353c3696..d930f6f693 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -499,6 +499,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) fPrintToConsole = GetBoolArg("-printtoconsole", false); fPrintToDebugger = GetBoolArg("-printtodebugger", false); fLogTimestamps = GetBoolArg("-logtimestamps", true); + bool fDisableWallet = GetBoolArg("-disablewallet", false); if (mapArgs.count("-timeout")) { @@ -587,7 +588,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) // ********************************************************* Step 5: verify wallet database integrity - if (1) { + if (!fDisableWallet) { uiInterface.InitMessage(_("Verifying wallet...")); if (!bitdb.Open(GetDataDir())) @@ -631,7 +632,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) if (r == CDBEnv::RECOVER_FAIL) return InitError(_("wallet.dat corrupt, salvage failed")); } - } // (1) + } // (!fDisableWallet) // ********************************************************* Step 6: network initialization @@ -900,7 +901,10 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) // ********************************************************* Step 8: load wallet - if (1) { + if (fDisableWallet) { + pwalletMain = NULL; + LogPrintf("Wallet disabled!\n"); + } else { uiInterface.InitMessage(_("Loading wallet...")); nStart = GetTimeMillis(); @@ -987,7 +991,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer) pwalletMain->SetBestChain(chainActive.GetLocator()); nWalletDBUpdated++; } - } // (1) + } // (!fDisableWallet) // ********************************************************* Step 9: import blocks |