mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +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:
parent
57d85d9bee
commit
be33f3f50b
7 changed files with 67 additions and 50 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue