diff options
author | John Newbery <john@johnnewbery.com> | 2017-08-28 13:33:59 -0400 |
---|---|---|
committer | John Newbery <john@johnnewbery.com> | 2017-09-07 16:21:26 -0700 |
commit | 290f3c56d9dd8a519920939a4fc440da832c1c63 (patch) | |
tree | c6a33d86aa941f6f3a7f6b17821ecf7d8464ccc6 /src/wallet | |
parent | 062d63102eb1e90168d28589de8bf182e9a6a7d3 (diff) |
[wallet] Add RegisterWalletRPC() function to wallet/init.cpp
Diffstat (limited to 'src/wallet')
-rw-r--r-- | src/wallet/init.cpp | 8 | ||||
-rw-r--r-- | src/wallet/init.h | 5 | ||||
-rw-r--r-- | src/wallet/rpcwallet.cpp | 3 | ||||
-rw-r--r-- | src/wallet/rpcwallet.h | 3 |
4 files changed, 16 insertions, 3 deletions
diff --git a/src/wallet/init.cpp b/src/wallet/init.cpp index 84318eac0a..9fd038150f 100644 --- a/src/wallet/init.cpp +++ b/src/wallet/init.cpp @@ -10,6 +10,7 @@ #include "utilmoneystr.h" #include "validation.h" #include "wallet/wallet.h" +#include "wallet/rpcwallet.h" std::string GetWalletHelpString(bool showDebug) { @@ -171,6 +172,13 @@ bool WalletParameterInteraction() return true; } +void RegisterWalletRPC(CRPCTable &t) +{ + if (gArgs.GetBoolArg("-disablewallet", false)) return; + + RegisterWalletRPCCommands(t); +} + bool VerifyWallets() { if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET)) diff --git a/src/wallet/init.h b/src/wallet/init.h index 1be2ef9273..588357119c 100644 --- a/src/wallet/init.h +++ b/src/wallet/init.h @@ -8,12 +8,17 @@ #include <string> +class CRPCTable; + //! Return the wallets help message. std::string GetWalletHelpString(bool showDebug); //! Wallets parameter interaction bool WalletParameterInteraction(); +//! Register wallet RPCs. +void RegisterWalletRPC(CRPCTable &tableRPC); + //! 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 (CWallet::ParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet). diff --git a/src/wallet/rpcwallet.cpp b/src/wallet/rpcwallet.cpp index 4ea53c4132..6ef3599a1c 100644 --- a/src/wallet/rpcwallet.cpp +++ b/src/wallet/rpcwallet.cpp @@ -3217,9 +3217,6 @@ static const CRPCCommand commands[] = void RegisterWalletRPCCommands(CRPCTable &t) { - if (gArgs.GetBoolArg("-disablewallet", false)) - return; - for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) t.appendCommand(commands[vcidx].name, &commands[vcidx]); } diff --git a/src/wallet/rpcwallet.h b/src/wallet/rpcwallet.h index db0808b93b..14e51610d9 100644 --- a/src/wallet/rpcwallet.h +++ b/src/wallet/rpcwallet.h @@ -5,7 +5,10 @@ #ifndef BITCOIN_WALLET_RPCWALLET_H #define BITCOIN_WALLET_RPCWALLET_H +#include <string> + class CRPCTable; +class CWallet; class JSONRPCRequest; void RegisterWalletRPCCommands(CRPCTable &t); |