| 290 | } |
| 291 | |
| 292 | bool 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 | |
| 310 | void InterruptHTTPRPC() |
| 311 | { |
no test coverage detected