Skip to content

Commit db198d5

Browse files
committed
Fix RPCTimerInterface ordering issue
Dispatching a QThread from a non Qt thread is not allowed. Always use the HTTPRPCTimerInterface (non QT) to dispatch RPCRunLater threads.
1 parent b1cf005 commit db198d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rpcserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
563563
if (timerInterfaces.empty())
564564
throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
565565
deadlineTimers.erase(name);
566-
RPCTimerInterface* timerInterface = timerInterfaces[0];
566+
RPCTimerInterface* timerInterface = timerInterfaces.back();
567567
LogPrint("rpc", "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
568568
deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
569569
}

0 commit comments

Comments
 (0)