Browse Source

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.
0.13
Jonas Schnelli 9 years ago
parent
commit
db198d51a6
No known key found for this signature in database
GPG Key ID: 29D4BCB6416F53EC
  1. 2
      src/rpcserver.cpp

2
src/rpcserver.cpp

@ -563,7 +563,7 @@ void RPCRunLater(const std::string& name, boost::function<void(void)> func, int6
if (timerInterfaces.empty()) if (timerInterfaces.empty())
throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC"); throw JSONRPCError(RPC_INTERNAL_ERROR, "No timer handler registered for RPC");
deadlineTimers.erase(name); 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()); 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)))); deadlineTimers.insert(std::make_pair(name, boost::shared_ptr<RPCTimerBase>(timerInterface->NewTimer(func, nSeconds*1000))));
} }

Loading…
Cancel
Save