| 306 | } |
| 307 | |
| 308 | void StopRPC() |
| 309 | { |
| 310 | static std::once_flag g_rpc_stop_flag; |
| 311 | // This function could be called twice if the GUI has been started with -server=1. |
| 312 | assert(!g_rpc_running); |
| 313 | std::call_once(g_rpc_stop_flag, []() { |
| 314 | LogPrint(BCLog::RPC, "Stopping RPC\n"); |
| 315 | WITH_LOCK(g_deadline_timers_mutex, deadlineTimers.clear()); |
| 316 | DeleteAuthCookie(); |
| 317 | g_rpcSignals.Stopped(); |
| 318 | }); |
| 319 | } |
| 320 | |
| 321 | bool IsRPCRunning() |
| 322 | { |
no test coverage detected