[wallet] Move wallet init functions into WalletInit class.

This commit is contained in:
John Newbery
2017-07-06 11:16:40 +01:00
parent ffc6e48b29
commit 5fb54210a6
3 changed files with 46 additions and 41 deletions

View File

@@ -190,7 +190,7 @@ void Shutdown()
StopRPC();
StopHTTPServer();
#ifdef ENABLE_WALLET
FlushWallets();
WalletInit::Flush();
#endif
StopMapPort();
@@ -250,7 +250,7 @@ void Shutdown()
pblocktree.reset();
}
#ifdef ENABLE_WALLET
StopWallets();
WalletInit::Stop();
#endif
#if ENABLE_ZMQ
@@ -272,7 +272,7 @@ void Shutdown()
GetMainSignals().UnregisterBackgroundSignalScheduler();
GetMainSignals().UnregisterWithMempoolSignals(mempool);
#ifdef ENABLE_WALLET
CloseWallets();
WalletInit::Close();
#endif
globalVerifyHandle.reset();
ECC_Stop();
@@ -416,7 +416,7 @@ std::string HelpMessage(HelpMessageMode mode)
" " + _("Whitelisted peers cannot be DoS banned and their transactions are always relayed, even if they are already in the mempool, useful e.g. for a gateway"));
#ifdef ENABLE_WALLET
strUsage += GetWalletHelpString(showDebug);
strUsage += WalletInit::GetHelpString(showDebug);
#endif
#if ENABLE_ZMQ
@@ -1092,8 +1092,7 @@ bool AppInitParameterInteraction()
nBytesPerSigOp = gArgs.GetArg("-bytespersigop", nBytesPerSigOp);
#ifdef ENABLE_WALLET
if (!WalletParameterInteraction())
return false;
if (!WalletInit::ParameterInteraction()) return false;
#endif
fIsBareMultisigStd = gArgs.GetBoolArg("-permitbaremultisig", DEFAULT_PERMIT_BAREMULTISIG);
@@ -1258,7 +1257,7 @@ bool AppInitMain()
*/
RegisterAllCoreRPCCommands(tableRPC);
#ifdef ENABLE_WALLET
RegisterWalletRPC(tableRPC);
WalletInit::RegisterRPC(tableRPC);
#endif
/* Start the RPC server already. It will be started in "warmup" mode
@@ -1277,8 +1276,7 @@ bool AppInitMain()
// ********************************************************* Step 5: verify wallet database integrity
#ifdef ENABLE_WALLET
if (!VerifyWallets())
return false;
if (!WalletInit::Verify()) return false;
#endif
// ********************************************************* Step 6: network initialization
// Note that we absolutely cannot open any actual connections
@@ -1598,8 +1596,7 @@ bool AppInitMain()
// ********************************************************* Step 8: load wallet
#ifdef ENABLE_WALLET
if (!OpenWallets())
return false;
if (!WalletInit::Open()) return false;
#else
LogPrintf("No wallet support compiled in!\n");
#endif
@@ -1749,7 +1746,7 @@ bool AppInitMain()
uiInterface.InitMessage(_("Done loading"));
#ifdef ENABLE_WALLET
StartWallets(scheduler);
WalletInit::Start(scheduler);
#endif
return true;