Bitcoin Core  0.18.99
P2P Digital Currency
dummywallet.cpp
Go to the documentation of this file.
1 // Copyright (c) 2018 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <stdio.h>
6 #include <util/system.h>
7 #include <walletinitinterface.h>
8 
9 class CWallet;
10 
11 namespace interfaces {
12 class Chain;
13 }
14 
16 public:
17 
18  bool HasWalletSupport() const override {return false;}
19  void AddWalletOptions() const override;
20  bool ParameterInteraction() const override {return true;}
21  void Construct(InitInterfaces& interfaces) const override {LogPrintf("No wallet support compiled in!\n");}
22 };
23 
25 {
27  "-addresstype",
28  "-avoidpartialspends",
29  "-changetype",
30  "-disablewallet",
31  "-discardfee=<amt>",
32  "-fallbackfee=<amt>",
33  "-keypool=<n>",
34  "-maxtxfee=<amt>",
35  "-mintxfee=<amt>",
36  "-paytxfee=<amt>",
37  "-rescan",
38  "-salvagewallet",
39  "-spendzeroconfchange",
40  "-txconfirmtarget=<n>",
41  "-upgradewallet",
42  "-wallet=<path>",
43  "-walletbroadcast",
44  "-walletdir=<dir>",
45  "-walletnotify=<cmd>",
46  "-walletrbf",
47  "-zapwallettxes=<mode>",
48  "-dblogsize=<n>",
49  "-flushwallet",
50  "-privdb",
51  "-walletrejectlongchains",
52  });
53 }
54 
56 
57 fs::path GetWalletDir()
58 {
59  throw std::logic_error("Wallet function called in non-wallet build.");
60 }
61 
62 std::vector<fs::path> ListWalletDir()
63 {
64  throw std::logic_error("Wallet function called in non-wallet build.");
65 }
66 
67 std::vector<std::shared_ptr<CWallet>> GetWallets()
68 {
69  throw std::logic_error("Wallet function called in non-wallet build.");
70 }
71 
72 std::shared_ptr<CWallet> LoadWallet(interfaces::Chain& chain, const std::string& name, std::string& error, std::string& warning)
73 {
74  throw std::logic_error("Wallet function called in non-wallet build.");
75 }
76 
77 namespace interfaces {
78 
79 class Wallet;
80 
81 std::unique_ptr<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet)
82 {
83  throw std::logic_error("Wallet function called in non-wallet build.");
84 }
85 
86 } // namespace interfaces
bool ParameterInteraction() const override
Check wallet parameter interaction.
Definition: dummywallet.cpp:20
std::vector< std::shared_ptr< CWallet > > GetWallets()
Definition: dummywallet.cpp:67
bool HasWalletSupport() const override
Is the wallet component enabled.
Definition: dummywallet.cpp:18
void AddHiddenArgs(const std::vector< std::string > &args)
Add many hidden arguments.
Definition: system.cpp:556
void AddWalletOptions() const override
Get wallet help string.
Definition: dummywallet.cpp:24
std::shared_ptr< CWallet > LoadWallet(interfaces::Chain &chain, const std::string &name, std::string &error, std::string &warning)
Definition: dummywallet.cpp:72
std::vector< fs::path > ListWalletDir()
Get wallets in wallet directory.
Definition: dummywallet.cpp:62
void Construct(InitInterfaces &interfaces) const override
Add wallets that should be opened to list of init interfaces.
Definition: dummywallet.cpp:21
const char * name
Definition: rest.cpp:38
std::unique_ptr< Wallet > MakeWallet(const std::shared_ptr< CWallet > &wallet)
Return implementation of Wallet interface.
Definition: dummywallet.cpp:81
const WalletInitInterface & g_wallet_init_interface
Definition: dummywallet.cpp:55
Interface giving clients (wallet processes, maybe other analysis tools in the future) ability to acce...
Definition: chain.h:58
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:692
ArgsManager gArgs
Definition: system.cpp:74
fs::path GetWalletDir()
Get the path of the wallet directory.
Definition: dummywallet.cpp:57
Pointers to interfaces used during init and destroyed on shutdown.
Definition: init.h:19
bool error(const char *fmt, const Args &... args)
Definition: system.h:61