mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-08 10:31:50 -05:00
[build] remove ENABLE_WALLET ifdef from httprpc.cpp
This commit is contained in:
parent
3076556cd0
commit
7d038dcb41
5 changed files with 15 additions and 10 deletions
|
@ -9,6 +9,7 @@
|
||||||
class DummyWalletInit : public WalletInitInterface {
|
class DummyWalletInit : public WalletInitInterface {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
bool HasWalletSupport() const override {return false;}
|
||||||
void AddWalletOptions() const override;
|
void AddWalletOptions() const override;
|
||||||
bool ParameterInteraction() const override {return true;}
|
bool ParameterInteraction() const override {return true;}
|
||||||
void RegisterRPC(CRPCTable &) const override {}
|
void RegisterRPC(CRPCTable &) const override {}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include <util.h>
|
#include <util.h>
|
||||||
#include <utilstrencodings.h>
|
#include <utilstrencodings.h>
|
||||||
#include <ui_interface.h>
|
#include <ui_interface.h>
|
||||||
|
#include <walletinitinterface.h>
|
||||||
#include <crypto/hmac_sha256.h>
|
#include <crypto/hmac_sha256.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
@ -240,10 +241,9 @@ bool StartHTTPRPC()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
RegisterHTTPHandler("/", true, HTTPReq_JSONRPC);
|
RegisterHTTPHandler("/", true, HTTPReq_JSONRPC);
|
||||||
#ifdef ENABLE_WALLET
|
if (g_wallet_init_interface.HasWalletSupport()) {
|
||||||
// ifdef can be removed once we switch to better endpoint support and API versioning
|
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
|
||||||
RegisterHTTPHandler("/wallet/", false, HTTPReq_JSONRPC);
|
}
|
||||||
#endif
|
|
||||||
struct event_base* eventBase = EventBase();
|
struct event_base* eventBase = EventBase();
|
||||||
assert(eventBase);
|
assert(eventBase);
|
||||||
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(eventBase);
|
httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(eventBase);
|
||||||
|
@ -260,9 +260,9 @@ void StopHTTPRPC()
|
||||||
{
|
{
|
||||||
LogPrint(BCLog::RPC, "Stopping HTTP RPC server\n");
|
LogPrint(BCLog::RPC, "Stopping HTTP RPC server\n");
|
||||||
UnregisterHTTPHandler("/", true);
|
UnregisterHTTPHandler("/", true);
|
||||||
#ifdef ENABLE_WALLET
|
if (g_wallet_init_interface.HasWalletSupport()) {
|
||||||
UnregisterHTTPHandler("/wallet/", false);
|
UnregisterHTTPHandler("/wallet/", false);
|
||||||
#endif
|
}
|
||||||
if (httpRPCTimerInterface) {
|
if (httpRPCTimerInterface) {
|
||||||
RPCUnsetTimerInterface(httpRPCTimerInterface.get());
|
RPCUnsetTimerInterface(httpRPCTimerInterface.get());
|
||||||
httpRPCTimerInterface.reset();
|
httpRPCTimerInterface.reset();
|
||||||
|
|
|
@ -13,9 +13,6 @@
|
||||||
class CScheduler;
|
class CScheduler;
|
||||||
class CWallet;
|
class CWallet;
|
||||||
|
|
||||||
class WalletInitInterface;
|
|
||||||
extern const WalletInitInterface& g_wallet_init_interface;
|
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
class thread_group;
|
class thread_group;
|
||||||
|
|
|
@ -19,6 +19,9 @@
|
||||||
class WalletInit : public WalletInitInterface {
|
class WalletInit : public WalletInitInterface {
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
//! Was the wallet component compiled in.
|
||||||
|
bool HasWalletSupport() const override {return true;}
|
||||||
|
|
||||||
//! Return the wallets help message.
|
//! Return the wallets help message.
|
||||||
void AddWalletOptions() const override;
|
void AddWalletOptions() const override;
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,8 @@ class CRPCTable;
|
||||||
|
|
||||||
class WalletInitInterface {
|
class WalletInitInterface {
|
||||||
public:
|
public:
|
||||||
|
/** Is the wallet component enabled */
|
||||||
|
virtual bool HasWalletSupport() const = 0;
|
||||||
/** Get wallet help string */
|
/** Get wallet help string */
|
||||||
virtual void AddWalletOptions() const = 0;
|
virtual void AddWalletOptions() const = 0;
|
||||||
/** Check wallet parameter interaction */
|
/** Check wallet parameter interaction */
|
||||||
|
@ -34,4 +36,6 @@ public:
|
||||||
virtual ~WalletInitInterface() {}
|
virtual ~WalletInitInterface() {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern const WalletInitInterface& g_wallet_init_interface;
|
||||||
|
|
||||||
#endif // BITCOIN_WALLETINITINTERFACE_H
|
#endif // BITCOIN_WALLETINITINTERFACE_H
|
||||||
|
|
Loading…
Add table
Reference in a new issue