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

Function RPCRunLater

src/rpc/server.cpp:530–538  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

528}
529
530void RPCRunLater(const std::string& name, std::function<void()> func, int64_t nSeconds)
531{
532 if (!timerInterface)
533 throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
534 LOCK(g_deadline_timers_mutex);
535 deadlineTimers.erase(name);
536 LogPrint(BCLog::RPC, "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
537 deadlineTimers.emplace(name, std::unique_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000)));
538}
539
540int RPCSerializationFlags()
541{

Callers 1

rpcRunLaterMethod · 0.85

Calls 4

JSONRPCErrorFunction · 0.85
eraseMethod · 0.45
NameMethod · 0.45
NewTimerMethod · 0.45

Tested by

no test coverage detected