1414#include < util.h>
1515#include < utilstrencodings.h>
1616#include < ui_interface.h>
17+ #include < walletinitinterface.h>
1718#include < crypto/hmac_sha256.h>
1819#include < stdio.h>
1920
@@ -240,10 +241,9 @@ bool StartHTTPRPC()
240241 return false ;
241242
242243 RegisterHTTPHandler (" /" , true , HTTPReq_JSONRPC);
243- #ifdef ENABLE_WALLET
244- // ifdef can be removed once we switch to better endpoint support and API versioning
245- RegisterHTTPHandler (" /wallet/" , false , HTTPReq_JSONRPC);
246- #endif
244+ if (g_wallet_init_interface.HasWalletSupport ()) {
245+ RegisterHTTPHandler (" /wallet/" , false , HTTPReq_JSONRPC);
246+ }
247247 struct event_base * eventBase = EventBase ();
248248 assert (eventBase);
249249 httpRPCTimerInterface = MakeUnique<HTTPRPCTimerInterface>(eventBase);
@@ -260,9 +260,9 @@ void StopHTTPRPC()
260260{
261261 LogPrint (BCLog::RPC, " Stopping HTTP RPC server\n " );
262262 UnregisterHTTPHandler (" /" , true );
263- # ifdef ENABLE_WALLET
264- UnregisterHTTPHandler (" /wallet/" , false );
265- # endif
263+ if (g_wallet_init_interface. HasWalletSupport ()) {
264+ UnregisterHTTPHandler (" /wallet/" , false );
265+ }
266266 if (httpRPCTimerInterface) {
267267 RPCUnsetTimerInterface (httpRPCTimerInterface.get ());
268268 httpRPCTimerInterface.reset ();
0 commit comments