BSHA3  0.17.99
P2P Blockchain, based on Bitcoin
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.h>
7 #include <walletinitinterface.h>
8 
9 class CWallet;
10 
12 public:
13 
14  bool HasWalletSupport() const override {return false;}
15  void AddWalletOptions() const override;
16  bool ParameterInteraction() const override {return true;}
17  void RegisterRPC(CRPCTable &) const override {}
18  bool Verify() const override {return true;}
19  bool Open() const override {LogPrintf("No wallet support compiled in!\n"); return true;}
20  void Start(CScheduler& scheduler) const override {}
21  void Flush() const override {}
22  void Stop() const override {}
23  void Close() const override {}
24 };
25 
27 {
28  std::vector<std::string> opts = {"-addresstype", "-changetype", "-disablewallet", "-discardfee=<amt>", "-fallbackfee=<amt>",
29  "-keypool=<n>", "-mintxfee=<amt>", "-paytxfee=<amt>", "-rescan", "-salvagewallet", "-spendzeroconfchange", "-txconfirmtarget=<n>",
30  "-upgradewallet", "-wallet=<path>", "-walletbroadcast", "-walletdir=<dir>", "-walletnotify=<cmd>", "-walletrbf", "-zapwallettxes=<mode>",
31  "-dblogsize=<n>", "-flushwallet", "-privdb", "-walletrejectlongchains"};
32  gArgs.AddHiddenArgs(opts);
33 }
34 
36 
37 fs::path GetWalletDir()
38 {
39  throw std::logic_error("Wallet function called in non-wallet build.");
40 }
41 
42 std::vector<fs::path> ListWalletDir()
43 {
44  throw std::logic_error("Wallet function called in non-wallet build.");
45 }
46 
47 std::vector<std::shared_ptr<CWallet>> GetWallets()
48 {
49  throw std::logic_error("Wallet function called in non-wallet build.");
50 }
51 
52 namespace interfaces {
53 
54 class Wallet;
55 
56 std::unique_ptr<Wallet> MakeWallet(const std::shared_ptr<CWallet>& wallet)
57 {
58  throw std::logic_error("Wallet function called in non-wallet build.");
59 }
60 
61 } // namespace interfaces
bool ParameterInteraction() const override
Check wallet parameter interaction.
Definition: dummywallet.cpp:16
Bitcoin RPC command dispatcher.
Definition: server.h:143
std::vector< std::shared_ptr< CWallet > > GetWallets()
Definition: dummywallet.cpp:47
bool HasWalletSupport() const override
Is the wallet component enabled.
Definition: dummywallet.cpp:14
void AddHiddenArgs(const std::vector< std::string > &args)
Add many hidden arguments.
Definition: util.cpp:586
void AddWalletOptions() const override
Get wallet help string.
Definition: dummywallet.cpp:26
std::vector< fs::path > ListWalletDir()
Get wallets in wallet directory.
Definition: dummywallet.cpp:42
Interface for accessing a wallet.
Definition: wallet.h:46
void Close() const override
Close wallets.
Definition: dummywallet.cpp:23
std::unique_ptr< Wallet > MakeWallet(const std::shared_ptr< CWallet > &wallet)
Return implementation of Wallet interface.
Definition: dummywallet.cpp:56
bool Verify() const override
Verify wallets.
Definition: dummywallet.cpp:18
const WalletInitInterface & g_wallet_init_interface
Definition: dummywallet.cpp:35
ArgsManager gArgs
Definition: util.cpp:88
void Flush() const override
Flush Wallets.
Definition: dummywallet.cpp:21
A CWallet is an extension of a keystore, which also maintains a set of transactions and balances...
Definition: wallet.h:599
fs::path GetWalletDir()
Get the path of the wallet directory.
Definition: dummywallet.cpp:37
bool Open() const override
Open wallets.
Definition: dummywallet.cpp:19
void Stop() const override
Stop Wallets.
Definition: dummywallet.cpp:22
void Start(CScheduler &scheduler) const override
Start wallets.
Definition: dummywallet.cpp:20
void RegisterRPC(CRPCTable &) const override
Register wallet RPC.
Definition: dummywallet.cpp:17