mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
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:
@@ -117,8 +117,11 @@ public:
|
||||
class HTTPEvent
|
||||
{
|
||||
public:
|
||||
/** Create a new event */
|
||||
HTTPEvent(struct event_base* base, bool deleteWhenTriggered, HTTPClosure* handler);
|
||||
/** Create a new event.
|
||||
* deleteWhenTriggered deletes this event object after the event is triggered (and the handler called)
|
||||
* handler is the handler to call when the event is triggered.
|
||||
*/
|
||||
HTTPEvent(struct event_base* base, bool deleteWhenTriggered, const boost::function<void(void)>& handler);
|
||||
~HTTPEvent();
|
||||
|
||||
/** Trigger the event. If tv is 0, trigger it immediately. Otherwise trigger it after
|
||||
@@ -126,13 +129,10 @@ public:
|
||||
*/
|
||||
void trigger(struct timeval* tv);
|
||||
|
||||
/** Internal function for handling, do not call directly */
|
||||
void _handle();
|
||||
|
||||
private:
|
||||
bool deleteWhenTriggered;
|
||||
boost::function<void(void)> handler;
|
||||
private:
|
||||
struct event* ev;
|
||||
boost::scoped_ptr<HTTPClosure> handler;
|
||||
};
|
||||
|
||||
#endif // BITCOIN_HTTPSERVER_H
|
||||
|
Reference in New Issue
Block a user