|
|
@ -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();
|
|
|
|