Skip to content

Commit

Permalink
Fix RPCTimerInterface ordering issue
Browse files Browse the repository at this point in the history
Dispatching a QThread from a non Qt thread is not allowed. Always use the HTTPRPCTimerInterface (non QT) to dispatch RPCRunLater threads.
  • Loading branch information
jonasschnelli committed Jan 8, 2016
1 parent b1cf005 commit db198d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rpcserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
if (timerInterfaces.empty())
throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
deadlineTimers.erase(name);
RPCTimerInterface* timerInterface = timerInterfaces[0];
RPCTimerInterface* timerInterface = timerInterfaces.back();
LogPrint("rpc", "queue run of timer %s in %i seconds (using %s)\n", name, nSeconds, timerInterface->Name());
deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
}
Expand Down

0 comments on commit db198d5

Please sign in to comment.