mirror of
https://github.com/xmrig/xmrig.git
synced 2024-11-06 00:17:39 +00:00
Sync changes with proxy.
This commit is contained in:
parent
6dda4ad41c
commit
14f0e8658c
3 changed files with 39 additions and 20 deletions
|
@ -30,6 +30,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
|
||||||
|
#include "common/crypto/Algorithm.h"
|
||||||
#include "common/net/Id.h"
|
#include "common/net/Id.h"
|
||||||
#include "common/net/Job.h"
|
#include "common/net/Job.h"
|
||||||
#include "common/net/Pool.h"
|
#include "common/net/Pool.h"
|
||||||
|
@ -66,16 +67,17 @@ public:
|
||||||
void setPool(const Pool &pool);
|
void setPool(const Pool &pool);
|
||||||
void tick(uint64_t now);
|
void tick(uint64_t now);
|
||||||
|
|
||||||
inline bool isReady() const { return m_state == ConnectedState && m_failures == 0; }
|
inline bool isReady() const { return m_state == ConnectedState && m_failures == 0; }
|
||||||
inline const char *host() const { return m_pool.host(); }
|
inline const char *host() const { return m_pool.host(); }
|
||||||
inline const char *ip() const { return m_ip; }
|
inline const char *ip() const { return m_ip; }
|
||||||
inline const Job &job() const { return m_job; }
|
inline const Job &job() const { return m_job; }
|
||||||
inline int id() const { return m_id; }
|
inline int id() const { return m_id; }
|
||||||
inline SocketState state() const { return m_state; }
|
inline SocketState state() const { return m_state; }
|
||||||
inline uint16_t port() const { return m_pool.port(); }
|
inline uint16_t port() const { return m_pool.port(); }
|
||||||
inline void setQuiet(bool quiet) { m_quiet = quiet; }
|
inline void setAlgo(const xmrig::Algorithm &algo) { m_pool.setAlgo(algo); }
|
||||||
inline void setRetries(int retries) { m_retries = retries; }
|
inline void setQuiet(bool quiet) { m_quiet = quiet; }
|
||||||
inline void setRetryPause(int ms) { m_retryPause = ms; }
|
inline void setRetries(int retries) { m_retries = retries; }
|
||||||
|
inline void setRetryPause(int ms) { m_retryPause = ms; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum Extensions {
|
enum Extensions {
|
||||||
|
|
|
@ -247,17 +247,15 @@ void Pool::adjust(xmrig::Algo algorithm)
|
||||||
m_algorithm.setVariant(xmrig::VARIANT_1);
|
m_algorithm.setVariant(xmrig::VARIANT_1);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_algorithms.push_back(m_algorithm);
|
rebuild();
|
||||||
|
}
|
||||||
|
|
||||||
# ifndef XMRIG_PROXY_PROJECT
|
|
||||||
if (m_algorithm.algo() != xmrig::CRYPTONIGHT_HEAVY) {
|
void Pool::setAlgo(const xmrig::Algorithm &algorithm)
|
||||||
addVariant(xmrig::VARIANT_1);
|
{
|
||||||
addVariant(xmrig::VARIANT_0);
|
m_algorithm = algorithm;
|
||||||
addVariant(xmrig::VARIANT_XTL);
|
|
||||||
addVariant(xmrig::VARIANT_IPBC);
|
rebuild();
|
||||||
addVariant(xmrig::VARIANT_AUTO);
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -309,3 +307,20 @@ void Pool::addVariant(xmrig::Variant variant)
|
||||||
|
|
||||||
m_algorithms.push_back(algorithm);
|
m_algorithms.push_back(algorithm);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Pool::rebuild()
|
||||||
|
{
|
||||||
|
m_algorithms.clear();
|
||||||
|
m_algorithms.push_back(m_algorithm);
|
||||||
|
|
||||||
|
# ifndef XMRIG_PROXY_PROJECT
|
||||||
|
if (m_algorithm.algo() != xmrig::CRYPTONIGHT_HEAVY) {
|
||||||
|
addVariant(xmrig::VARIANT_1);
|
||||||
|
addVariant(xmrig::VARIANT_0);
|
||||||
|
addVariant(xmrig::VARIANT_XTL);
|
||||||
|
addVariant(xmrig::VARIANT_IPBC);
|
||||||
|
addVariant(xmrig::VARIANT_AUTO);
|
||||||
|
}
|
||||||
|
# endif
|
||||||
|
}
|
||||||
|
|
|
@ -78,6 +78,7 @@ public:
|
||||||
bool setUserpass(const char *userpass);
|
bool setUserpass(const char *userpass);
|
||||||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||||
void adjust(xmrig::Algo algorithm);
|
void adjust(xmrig::Algo algorithm);
|
||||||
|
void setAlgo(const xmrig::Algorithm &algorithm);
|
||||||
|
|
||||||
# ifdef APP_DEBUG
|
# ifdef APP_DEBUG
|
||||||
void print() const;
|
void print() const;
|
||||||
|
@ -86,6 +87,7 @@ public:
|
||||||
private:
|
private:
|
||||||
bool parseIPv6(const char *addr);
|
bool parseIPv6(const char *addr);
|
||||||
void addVariant(xmrig::Variant variant);
|
void addVariant(xmrig::Variant variant);
|
||||||
|
void rebuild();
|
||||||
|
|
||||||
bool m_nicehash;
|
bool m_nicehash;
|
||||||
int m_keepAlive;
|
int m_keepAlive;
|
||||||
|
|
Loading…
Reference in a new issue