Changeset View
Changeset View
Standalone View
Standalone View
src/rpc/server.cpp
Show First 20 Lines • Show All 571 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
void RPCUnsetTimerInterface(RPCTimerInterface *iface) { | void RPCUnsetTimerInterface(RPCTimerInterface *iface) { | ||||
if (timerInterface == iface) { | if (timerInterface == iface) { | ||||
timerInterface = nullptr; | timerInterface = nullptr; | ||||
} | } | ||||
} | } | ||||
void RPCRunLater(const std::string &name, std::function<void(void)> func, | void RPCRunLater(const std::string &name, std::function<void()> func, | ||||
int64_t nSeconds) { | int64_t nSeconds) { | ||||
if (!timerInterface) { | if (!timerInterface) { | ||||
throw JSONRPCError(RPC_INTERNAL_ERROR, | throw JSONRPCError(RPC_INTERNAL_ERROR, | ||||
"No timer handler registered for RPC"); | "No timer handler registered for RPC"); | ||||
} | } | ||||
deadlineTimers.erase(name); | deadlineTimers.erase(name); | ||||
LogPrint(BCLog::RPC, "queue run of timer %s in %i seconds (using %s)\n", | LogPrint(BCLog::RPC, "queue run of timer %s in %i seconds (using %s)\n", | ||||
name, nSeconds, timerInterface->Name()); | name, nSeconds, timerInterface->Name()); | ||||
Show All 10 Lines |