mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
[wallet] Add RegisterWalletRPC() function to wallet/init.cpp
This commit is contained in:
parent
062d63102e
commit
290f3c56d9
5 changed files with 17 additions and 4 deletions
|
@ -1017,7 +1017,7 @@ bool AppInitParameterInteraction()
|
||||||
|
|
||||||
RegisterAllCoreRPCCommands(tableRPC);
|
RegisterAllCoreRPCCommands(tableRPC);
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
RegisterWalletRPCCommands(tableRPC);
|
RegisterWalletRPC(tableRPC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
nConnectTimeout = gArgs.GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT);
|
nConnectTimeout = gArgs.GetArg("-timeout", DEFAULT_CONNECT_TIMEOUT);
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "utilmoneystr.h"
|
#include "utilmoneystr.h"
|
||||||
#include "validation.h"
|
#include "validation.h"
|
||||||
#include "wallet/wallet.h"
|
#include "wallet/wallet.h"
|
||||||
|
#include "wallet/rpcwallet.h"
|
||||||
|
|
||||||
std::string GetWalletHelpString(bool showDebug)
|
std::string GetWalletHelpString(bool showDebug)
|
||||||
{
|
{
|
||||||
|
@ -171,6 +172,13 @@ bool WalletParameterInteraction()
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RegisterWalletRPC(CRPCTable &t)
|
||||||
|
{
|
||||||
|
if (gArgs.GetBoolArg("-disablewallet", false)) return;
|
||||||
|
|
||||||
|
RegisterWalletRPCCommands(t);
|
||||||
|
}
|
||||||
|
|
||||||
bool VerifyWallets()
|
bool VerifyWallets()
|
||||||
{
|
{
|
||||||
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET))
|
if (gArgs.GetBoolArg("-disablewallet", DEFAULT_DISABLE_WALLET))
|
||||||
|
|
|
@ -8,12 +8,17 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
class CRPCTable;
|
||||||
|
|
||||||
//! Return the wallets help message.
|
//! Return the wallets help message.
|
||||||
std::string GetWalletHelpString(bool showDebug);
|
std::string GetWalletHelpString(bool showDebug);
|
||||||
|
|
||||||
//! Wallets parameter interaction
|
//! Wallets parameter interaction
|
||||||
bool WalletParameterInteraction();
|
bool WalletParameterInteraction();
|
||||||
|
|
||||||
|
//! Register wallet RPCs.
|
||||||
|
void RegisterWalletRPC(CRPCTable &tableRPC);
|
||||||
|
|
||||||
//! Responsible for reading and validating the -wallet arguments and verifying the wallet database.
|
//! 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
|
// 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).
|
// being loaded (CWallet::ParameterInteraction forbids -salvagewallet, -zapwallettxes or -upgradewallet with multiwallet).
|
||||||
|
|
|
@ -3217,9 +3217,6 @@ static const CRPCCommand commands[] =
|
||||||
|
|
||||||
void RegisterWalletRPCCommands(CRPCTable &t)
|
void RegisterWalletRPCCommands(CRPCTable &t)
|
||||||
{
|
{
|
||||||
if (gArgs.GetBoolArg("-disablewallet", false))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++)
|
||||||
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
t.appendCommand(commands[vcidx].name, &commands[vcidx]);
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
#ifndef BITCOIN_WALLET_RPCWALLET_H
|
#ifndef BITCOIN_WALLET_RPCWALLET_H
|
||||||
#define BITCOIN_WALLET_RPCWALLET_H
|
#define BITCOIN_WALLET_RPCWALLET_H
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
class CRPCTable;
|
class CRPCTable;
|
||||||
|
class CWallet;
|
||||||
class JSONRPCRequest;
|
class JSONRPCRequest;
|
||||||
|
|
||||||
void RegisterWalletRPCCommands(CRPCTable &t);
|
void RegisterWalletRPCCommands(CRPCTable &t);
|
||||||
|
|
Loading…
Add table
Reference in a new issue