|
3 | 3 | // Distributed under the MIT software license, see the accompanying |
4 | 4 | // file COPYING or http://www.opensource.org/licenses/mit-license.php. |
5 | 5 |
|
6 | | -#include <wallet/init.h> |
7 | | - |
8 | 6 | #include <chainparams.h> |
9 | 7 | #include <net.h> |
10 | 8 | #include <util.h> |
11 | 9 | #include <utilmoneystr.h> |
12 | 10 | #include <validation.h> |
| 11 | +#include <walletinitinterface.h> |
13 | 12 | #include <wallet/rpcwallet.h> |
14 | 13 | #include <wallet/wallet.h> |
15 | 14 | #include <wallet/walletutil.h> |
16 | 15 |
|
| 16 | +class WalletInit : public WalletInitInterface { |
| 17 | +public: |
| 18 | + |
| 19 | + //! Return the wallets help message. |
| 20 | + std::string GetHelpString(bool showDebug) override; |
| 21 | + |
| 22 | + //! Wallets parameter interaction |
| 23 | + bool ParameterInteraction() override; |
| 24 | + |
| 25 | + //! Register wallet RPCs. |
| 26 | + void RegisterRPC(CRPCTable &tableRPC) override; |
| 27 | + |
| 28 | + //! Responsible for reading and validating the -wallet arguments and verifying the wallet database. |
| 29 | + // This function will perform salvage on the wallet if requested, as long as only one wallet is |
| 30 | + // being loaded (WalletParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet). |
| 31 | + bool Verify() override; |
| 32 | + |
| 33 | + //! Load wallet databases. |
| 34 | + bool Open() override; |
| 35 | + |
| 36 | + //! Complete startup of wallets. |
| 37 | + void Start(CScheduler& scheduler) override; |
| 38 | + |
| 39 | + //! Flush all wallets in preparation for shutdown. |
| 40 | + void Flush() override; |
| 41 | + |
| 42 | + //! Stop all wallets. Wallets will be flushed first. |
| 43 | + void Stop() override; |
| 44 | + |
| 45 | + //! Close all wallets. |
| 46 | + void Close() override; |
| 47 | +}; |
| 48 | + |
| 49 | +std::unique_ptr<WalletInitInterface> g_wallet_init_interface(new WalletInit); |
| 50 | + |
17 | 51 | std::string WalletInit::GetHelpString(bool showDebug) |
18 | 52 | { |
19 | 53 | std::string strUsage = HelpMessageGroup(_("Wallet options:")); |
|
0 commit comments