Implement RPCTimerHandler for Qt RPC console

Implement RPCTimerHandler for Qt RPC console, so that `walletpassphrase`
works with GUI and `-server=0`.

Also simplify HTTPEvent-related code by using boost::function directly.
This commit is contained in:
Wladimir J. van der Laan
2015-08-28 16:46:20 +02:00
parent 57d85d9bee
commit be33f3f50b
7 changed files with 67 additions and 50 deletions

View File

@@ -92,12 +92,12 @@ public:
/** Implementation name */
virtual const char *Name() = 0;
/** Factory function for timers.
* RPC will call the function to create a timer that will call func in *seconds* seconds.
* RPC will call the function to create a timer that will call func in *millis* milliseconds.
* @note As the RPC mechanism is backend-neutral, it can use different implementations of timers.
* This is needed to cope with the case in which there is no HTTP server, but
* only GUI RPC console, and to break the dependency of pcserver on httprpc.
*/
virtual RPCTimerBase* NewTimer(boost::function<void(void)>&, int64_t) = 0;
virtual RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) = 0;
};
/** Register factory function for timers */