#1202 Fixed algorithm verification in donate strategy.
This commit is contained in:
parent
e66eeefb14
commit
680081b93b
5 changed files with 41 additions and 34 deletions
|
@ -34,6 +34,7 @@
|
|||
#include "base/kernel/interfaces/IStrategyListener.h"
|
||||
#include "base/kernel/interfaces/ITimerListener.h"
|
||||
#include "base/net/stratum/Pool.h"
|
||||
#include "base/tools/Object.h"
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
@ -47,6 +48,8 @@ class IStrategyListener;
|
|||
class DonateStrategy : public IStrategy, public IStrategyListener, public ITimerListener, public IClientListener
|
||||
{
|
||||
public:
|
||||
XMRIG_DISABLE_COPY_MOVE_DEFAULT(DonateStrategy)
|
||||
|
||||
DonateStrategy(Controller *controller, IStrategyListener *listener);
|
||||
~DonateStrategy() override;
|
||||
|
||||
|
@ -57,8 +60,6 @@ protected:
|
|||
inline void onJobReceived(IClient *client, const Job &job, const rapidjson::Value &) override { setJob(client, job); }
|
||||
inline void onResultAccepted(IClient *client, const SubmitResult &result, const char *error) override { setResult(client, result, error); }
|
||||
inline void onResultAccepted(IStrategy *, IClient *client, const SubmitResult &result, const char *error) override { setResult(client, result, error); }
|
||||
inline void onVerifyAlgorithm(const IClient *, const Algorithm &, bool *) override {}
|
||||
inline void onVerifyAlgorithm(IStrategy *, const IClient *, const Algorithm &, bool *) override {}
|
||||
inline void resume() override {}
|
||||
|
||||
int64_t submit(const JobResult &result) override;
|
||||
|
@ -74,6 +75,8 @@ protected:
|
|||
void onLogin(IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms) override;
|
||||
void onLogin(IStrategy *strategy, IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms) override;
|
||||
void onLoginSuccess(IClient *client) override;
|
||||
void onVerifyAlgorithm(const IClient *client, const Algorithm &algorithm, bool *ok) override;
|
||||
void onVerifyAlgorithm(IStrategy *strategy, const IClient *client, const Algorithm &algorithm, bool *ok) override;
|
||||
|
||||
void onTimer(const Timer *timer) override;
|
||||
|
||||
|
@ -96,19 +99,19 @@ private:
|
|||
void setState(State state);
|
||||
|
||||
Algorithm m_algorithm;
|
||||
bool m_tls;
|
||||
char m_userId[65];
|
||||
bool m_tls = false;
|
||||
char m_userId[65] = { 0 };
|
||||
const uint64_t m_donateTime;
|
||||
const uint64_t m_idleTime;
|
||||
Controller *m_controller;
|
||||
IClient *m_proxy;
|
||||
IStrategy *m_strategy;
|
||||
IClient *m_proxy = nullptr;
|
||||
IStrategy *m_strategy = nullptr;
|
||||
IStrategyListener *m_listener;
|
||||
State m_state;
|
||||
State m_state = STATE_NEW;
|
||||
std::vector<Pool> m_pools;
|
||||
Timer *m_timer;
|
||||
uint64_t m_now;
|
||||
uint64_t m_timestamp;
|
||||
Timer *m_timer = nullptr;
|
||||
uint64_t m_now = 0;
|
||||
uint64_t m_timestamp = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue