Restored algo field in login request.
This commit is contained in:
parent
f590cf58fb
commit
0ab26a1619
14 changed files with 129 additions and 35 deletions
|
@ -575,19 +575,6 @@ void xmrig::Client::login()
|
|||
params.AddMember("rigid", m_pool.rigId().toJSON(), allocator);
|
||||
}
|
||||
|
||||
//# ifdef XMRIG_PROXY_PROJECT FIXME
|
||||
// if (m_pool.algorithm().variant() != xmrig::VARIANT_AUTO)
|
||||
//# endif
|
||||
// {
|
||||
// Value algo(kArrayType);
|
||||
|
||||
// for (const auto &a : m_pool.algorithms()) {
|
||||
// algo.PushBack(StringRef(a.shortName()), allocator);
|
||||
// }
|
||||
|
||||
// params.AddMember("algo", algo, allocator);
|
||||
// }
|
||||
|
||||
m_listener->onLogin(this, doc, params);
|
||||
|
||||
JsonRequest::create(doc, 1, "login", params);
|
||||
|
|
|
@ -113,7 +113,7 @@ void xmrig::FailoverStrategy::resume()
|
|||
}
|
||||
|
||||
|
||||
void xmrig::FailoverStrategy::setAlgo(const xmrig::Algorithm &algo)
|
||||
void xmrig::FailoverStrategy::setAlgo(const Algorithm &algo)
|
||||
{
|
||||
for (IClient *client : m_pools) {
|
||||
client->setAlgo(algo);
|
||||
|
@ -163,6 +163,12 @@ void xmrig::FailoverStrategy::onClose(IClient *client, int failures)
|
|||
}
|
||||
|
||||
|
||||
void xmrig::FailoverStrategy::onLogin(IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms)
|
||||
{
|
||||
m_listener->onLogin(this, client, doc, params);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::FailoverStrategy::onJobReceived(IClient *client, const Job &job, const rapidjson::Value &)
|
||||
{
|
||||
if (m_active == client->id()) {
|
||||
|
|
|
@ -51,9 +51,8 @@ public:
|
|||
void add(const Pool &pool);
|
||||
|
||||
protected:
|
||||
inline bool isActive() const override { return m_active >= 0; }
|
||||
inline IClient *client() const override { return isActive() ? active() : m_pools[m_index]; }
|
||||
inline void onLogin(IClient *, rapidjson::Document &, rapidjson::Value &) override {}
|
||||
inline bool isActive() const override { return m_active >= 0; }
|
||||
inline IClient *client() const override { return isActive() ? active() : m_pools[m_index]; }
|
||||
|
||||
int64_t submit(const JobResult &result) override;
|
||||
void connect() override;
|
||||
|
@ -64,6 +63,7 @@ protected:
|
|||
|
||||
void onClose(IClient *client, int failures) override;
|
||||
void onJobReceived(IClient *client, const Job &job, const rapidjson::Value ¶ms) override;
|
||||
void onLogin(IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms) override;
|
||||
void onLoginSuccess(IClient *client) override;
|
||||
void onResultAccepted(IClient *client, const SubmitResult &result, const char *error) override;
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ void xmrig::SinglePoolStrategy::resume()
|
|||
}
|
||||
|
||||
|
||||
void xmrig::SinglePoolStrategy::setAlgo(const xmrig::Algorithm &algo)
|
||||
void xmrig::SinglePoolStrategy::setAlgo(const Algorithm &algo)
|
||||
{
|
||||
m_client->setAlgo(algo);
|
||||
}
|
||||
|
@ -119,6 +119,12 @@ void xmrig::SinglePoolStrategy::onJobReceived(IClient *client, const Job &job, c
|
|||
}
|
||||
|
||||
|
||||
void xmrig::SinglePoolStrategy::onLogin(IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms)
|
||||
{
|
||||
m_listener->onLogin(this, client, doc, params);
|
||||
}
|
||||
|
||||
|
||||
void xmrig::SinglePoolStrategy::onLoginSuccess(IClient *client)
|
||||
{
|
||||
m_active = true;
|
||||
|
|
|
@ -45,9 +45,8 @@ public:
|
|||
~SinglePoolStrategy() override;
|
||||
|
||||
protected:
|
||||
inline bool isActive() const override { return m_active; }
|
||||
inline IClient *client() const override { return m_client; }
|
||||
inline void onLogin(IClient *, rapidjson::Document &, rapidjson::Value &) override {}
|
||||
inline bool isActive() const override { return m_active; }
|
||||
inline IClient *client() const override { return m_client; }
|
||||
|
||||
int64_t submit(const JobResult &result) override;
|
||||
void connect() override;
|
||||
|
@ -58,6 +57,7 @@ protected:
|
|||
|
||||
void onClose(IClient *client, int failures) override;
|
||||
void onJobReceived(IClient *client, const Job &job, const rapidjson::Value ¶ms) override;
|
||||
void onLogin(IClient *client, rapidjson::Document &doc, rapidjson::Value ¶ms) override;
|
||||
void onLoginSuccess(IClient *client) override;
|
||||
void onResultAccepted(IClient *client, const SubmitResult &result, const char *error) override;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue