MCPcopy Create free account
hub / github.com/ElementsProject/elements / StartHTTPRPC

Function StartHTTPRPC

src/httprpc.cpp:292–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292bool StartHTTPRPC(const std::any& context)
293{
294 LogPrint(BCLog::RPC, "Starting HTTP RPC server\n");
295 if (!InitRPCAuthentication())
296 return false;
297
298 auto handle_rpc = [context](HTTPRequest* req, const std::string&) { return HTTPReq_JSONRPC(context, req); };
299 RegisterHTTPHandler("/", true, handle_rpc);
300 if (g_wallet_init_interface.HasWalletSupport()) {
301 RegisterHTTPHandler("/wallet/", false, handle_rpc);
302 }
303 struct event_base* eventBase = EventBase();
304 assert(eventBase);
305 httpRPCTimerInterface = std::make_unique<HTTPRPCTimerInterface>(eventBase);
306 RPCSetTimerInterface(httpRPCTimerInterface.get());
307 return true;
308}
309
310void InterruptHTTPRPC()
311{

Callers 1

AppInitServersFunction · 0.85

Calls 7

InitRPCAuthenticationFunction · 0.85
HTTPReq_JSONRPCFunction · 0.85
RegisterHTTPHandlerFunction · 0.85
EventBaseFunction · 0.85
RPCSetTimerInterfaceFunction · 0.85
HasWalletSupportMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected