@@ -33,11 +33,6 @@ static GlobalMutex g_rpc_warmup_mutex;
3333static std::atomic<bool > g_rpc_running{false };
3434static bool fRPCInWarmup GUARDED_BY (g_rpc_warmup_mutex) = true;
3535static std::string rpcWarmupStatus GUARDED_BY (g_rpc_warmup_mutex) = "RPC server started";
36- /* Timer-creating functions */
37- static RPCTimerInterface* timerInterface = nullptr ;
38- /* Map of name to timer. */
39- static GlobalMutex g_deadline_timers_mutex;
40- static std::map<std::string, std::unique_ptr<RPCTimerBase> > deadlineTimers GUARDED_BY (g_deadline_timers_mutex);
4136static bool ExecuteCommand (const CRPCCommand& command, const JSONRPCRequest& request, UniValue& result, bool last_handler);
4237
4338struct RPCCommandExecutionInfo
@@ -305,7 +300,6 @@ void StopRPC()
305300 assert (!g_rpc_running);
306301 std::call_once (g_rpc_stop_flag, [&]() {
307302 LogDebug (BCLog::RPC, " Stopping RPC\n " );
308- WITH_LOCK (g_deadline_timers_mutex, deadlineTimers.clear ());
309303 DeleteAuthCookie ();
310304 LogDebug (BCLog::RPC, " RPC stopped.\n " );
311305 });
@@ -547,31 +541,4 @@ UniValue CRPCTable::dumpArgMap(const JSONRPCRequest& args_request) const
547541 return ret;
548542}
549543
550- void RPCSetTimerInterfaceIfUnset (RPCTimerInterface *iface)
551- {
552- if (!timerInterface)
553- timerInterface = iface;
554- }
555-
556- void RPCSetTimerInterface (RPCTimerInterface *iface)
557- {
558- timerInterface = iface;
559- }
560-
561- void RPCUnsetTimerInterface (RPCTimerInterface *iface)
562- {
563- if (timerInterface == iface)
564- timerInterface = nullptr ;
565- }
566-
567- void RPCRunLater (const std::string& name, std::function<void ()> func, int64_t nSeconds)
568- {
569- if (!timerInterface)
570- throw JSONRPCError (RPC_INTERNAL_ERROR, " No timer handler registered for RPC" );
571- LOCK (g_deadline_timers_mutex);
572- deadlineTimers.erase (name);
573- LogDebug (BCLog::RPC, " queue run of timer %s in %i seconds (using %s)\n " , name, nSeconds, timerInterface->Name ());
574- deadlineTimers.emplace (name, std::unique_ptr<RPCTimerBase>(timerInterface->NewTimer (func, nSeconds*1000 )));
575- }
576-
577544CRPCTable tableRPC;
0 commit comments