Skip to content

Commit

Permalink
Add -disablewallet option, to disable wallet support (and BDB)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Garzik authored and laanwj committed Nov 13, 2013
1 parent f9ee7a0 commit e6b7e3d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
{
Expand Down Expand Up @@ -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()))
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -987,7 +991,7 @@ bool AppInit2(boost::thread_group& threadGroup, bool fForceServer)
pwalletMain->SetBestChain(chainActive.GetLocator());
nWalletDBUpdated++;
}
} // (1)
} // (!fDisableWallet)

// ********************************************************* Step 9: import blocks

Expand Down

0 comments on commit e6b7e3d

Please sign in to comment.