From 49baa4a462193d8d82b51d464740aa5f1114edf1 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Wed, 21 Feb 2018 11:38:53 -0500 Subject: [wallet] Use global g_wallet_init_interface to init/destroy the wallet. This commit creates a global g_wallet_init_interface, which is created in bitcoind and bitcoin-qt. g_wallet_init_interface is used to init and destroy the wallet. This removes the dependency from init.cpp on the wallet library. --- src/wallet/init.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/wallet') diff --git a/src/wallet/init.h b/src/wallet/init.h index e6c9ffb05b..f8be90d3e3 100644 --- a/src/wallet/init.h +++ b/src/wallet/init.h @@ -6,42 +6,43 @@ #ifndef BITCOIN_WALLET_INIT_H #define BITCOIN_WALLET_INIT_H +#include #include class CRPCTable; class CScheduler; -class WalletInit { +class WalletInit : public WalletInitInterface { public: //! Return the wallets help message. - static std::string GetHelpString(bool showDebug); + std::string GetHelpString(bool showDebug) override; //! Wallets parameter interaction - static bool ParameterInteraction(); + bool ParameterInteraction() override; //! Register wallet RPCs. - static void RegisterRPC(CRPCTable &tableRPC); + void RegisterRPC(CRPCTable &tableRPC) override; //! Responsible for reading and validating the -wallet arguments and verifying the wallet database. // This function will perform salvage on the wallet if requested, as long as only one wallet is // being loaded (WalletParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet). - static bool Verify(); + bool Verify() override; //! Load wallet databases. - static bool Open(); + bool Open() override; //! Complete startup of wallets. - static void Start(CScheduler& scheduler); + void Start(CScheduler& scheduler) override; //! Flush all wallets in preparation for shutdown. - static void Flush(); + void Flush() override; //! Stop all wallets. Wallets will be flushed first. - static void Stop(); + void Stop() override; //! Close all wallets. - static void Close(); + void Close() override; }; #endif // BITCOIN_WALLET_INIT_H -- cgit v1.2.3