mirror of
https://github.com/xmrig/xmrig.git
synced 2025-02-02 11:16:37 +00:00
#97 Ignore keepalive option with minergate and nicehash.com
This commit is contained in:
parent
af51513614
commit
914fdd5f0a
4 changed files with 25 additions and 8 deletions
|
@ -261,6 +261,10 @@ Options::Options(int argc, char **argv) :
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (Url *url : m_pools) {
|
||||||
|
url->applyExceptions();
|
||||||
|
}
|
||||||
|
|
||||||
m_ready = true;
|
m_ready = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ static inline double normalize(double d)
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
return std::floor(d * 10.0) / 10.0;
|
return std::floor(d * 100.0) / 100.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|
||||||
#include "net/Url.h"
|
#include "net/Url.h"
|
||||||
|
@ -87,12 +88,6 @@ Url::~Url()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Url::isNicehash() const
|
|
||||||
{
|
|
||||||
return isValid() && (m_nicehash || strstr(m_host, ".nicehash.com"));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
bool Url::parse(const char *url)
|
bool Url::parse(const char *url)
|
||||||
{
|
{
|
||||||
const char *p = strstr(url, "://");
|
const char *p = strstr(url, "://");
|
||||||
|
@ -144,6 +139,23 @@ bool Url::setUserpass(const char *userpass)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Url::applyExceptions()
|
||||||
|
{
|
||||||
|
if (!isValid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(m_host, ".nicehash.com")) {
|
||||||
|
m_keepAlive = false;
|
||||||
|
m_nicehash = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strstr(m_host, ".minergate.com")) {
|
||||||
|
m_keepAlive = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Url::setPassword(const char *password)
|
void Url::setPassword(const char *password)
|
||||||
{
|
{
|
||||||
if (!password) {
|
if (!password) {
|
||||||
|
|
|
@ -41,6 +41,7 @@ public:
|
||||||
~Url();
|
~Url();
|
||||||
|
|
||||||
inline bool isKeepAlive() const { return m_keepAlive; }
|
inline bool isKeepAlive() const { return m_keepAlive; }
|
||||||
|
inline bool isNicehash() const { return m_nicehash; }
|
||||||
inline bool isValid() const { return m_host && m_port > 0; }
|
inline bool isValid() const { return m_host && m_port > 0; }
|
||||||
inline const char *host() const { return m_host; }
|
inline const char *host() const { return m_host; }
|
||||||
inline const char *password() const { return m_password ? m_password : kDefaultPassword; }
|
inline const char *password() const { return m_password ? m_password : kDefaultPassword; }
|
||||||
|
@ -49,9 +50,9 @@ public:
|
||||||
inline void setKeepAlive(bool keepAlive) { m_keepAlive = keepAlive; }
|
inline void setKeepAlive(bool keepAlive) { m_keepAlive = keepAlive; }
|
||||||
inline void setNicehash(bool nicehash) { m_nicehash = nicehash; }
|
inline void setNicehash(bool nicehash) { m_nicehash = nicehash; }
|
||||||
|
|
||||||
bool isNicehash() const;
|
|
||||||
bool parse(const char *url);
|
bool parse(const char *url);
|
||||||
bool setUserpass(const char *userpass);
|
bool setUserpass(const char *userpass);
|
||||||
|
void applyExceptions();
|
||||||
void setPassword(const char *password);
|
void setPassword(const char *password);
|
||||||
void setUser(const char *user);
|
void setUser(const char *user);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue