Backport unified client timer from proxy project.

This commit is contained in:
XMRig 2017-08-14 08:41:54 +03:00
parent 5ad1a48489
commit 9975b4e4cd
13 changed files with 105 additions and 22 deletions

View file

@ -57,15 +57,20 @@ protected:
void onResultAccepted(Client *client, int64_t seq, uint32_t diff, uint64_t ms, const char *error) override;
private:
void setJob(Client *client, const Job &job);
constexpr static int kTickInterval = 1 * 1000;
void setJob(Client *client, const Job &job);
void tick();
static void onTick(uv_timer_t *handle);
bool m_donateActive;
char *m_agent;
const Options *m_options;
IStrategy *m_donate;
IStrategy *m_strategy;
uint64_t m_accepted;
uint64_t m_rejected;
uv_timer_t m_timer;
};