xmrig v6.2.2 based release
This commit is contained in:
commit
316af8c2b9
16 changed files with 136 additions and 34 deletions
|
@ -34,7 +34,7 @@
|
|||
|
||||
static inline OSVERSIONINFOEX winOsVersion()
|
||||
{
|
||||
using RtlGetVersionFunction = NTSTATUS (*)(LPOSVERSIONINFO);
|
||||
typedef NTSTATUS (NTAPI *RtlGetVersionFunction)(LPOSVERSIONINFO);
|
||||
OSVERSIONINFOEX result = { sizeof(OSVERSIONINFOEX), 0, 0, 0, 0, {'\0'}, 0, 0, 0, 0, 0};
|
||||
|
||||
HMODULE ntdll = GetModuleHandleW(L"ntdll.dll");
|
||||
|
|
|
@ -145,6 +145,22 @@ void xmrig::EthStratumClient::parseNotification(const char *method, const rapidj
|
|||
return;
|
||||
}
|
||||
|
||||
if (strcmp(method, "mining.set_extranonce") == 0) {
|
||||
if (!params.IsArray()) {
|
||||
LOG_ERR("%s " RED("invalid mining.set_extranonce notification: params is not an array"), tag());
|
||||
return;
|
||||
}
|
||||
|
||||
auto arr = params.GetArray();
|
||||
|
||||
if (arr.Empty()) {
|
||||
LOG_ERR("%s " RED("invalid mining.set_extranonce notification: params array is empty"), tag());
|
||||
return;
|
||||
}
|
||||
|
||||
setExtraNonce(arr[0]);
|
||||
}
|
||||
|
||||
if (strcmp(method, "mining.notify") == 0) {
|
||||
if (!params.IsArray()) {
|
||||
LOG_ERR("%s " RED("invalid mining.notify notification: params is not an array"), tag());
|
||||
|
@ -345,6 +361,14 @@ void xmrig::EthStratumClient::onSubscribeResponse(const rapidjson::Value &result
|
|||
}
|
||||
|
||||
setExtraNonce(result.GetArray()[1]);
|
||||
|
||||
if (m_pool.isNicehash()) {
|
||||
using namespace rapidjson;
|
||||
Document doc(kObjectType);
|
||||
Value params(kArrayType);
|
||||
JsonRequest::create(doc, m_sequence, "mining.extranonce.subscribe", params);
|
||||
send(doc);
|
||||
}
|
||||
} catch (const std::exception &ex) {
|
||||
LOG_ERR("%s " RED("%s"), tag(), ex.what());
|
||||
|
||||
|
|
|
@ -74,6 +74,9 @@ const char *Pool::kUrl = "url";
|
|||
const char *Pool::kUser = "user";
|
||||
|
||||
|
||||
const char *Pool::kNicehashHost = "nicehash.com";
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -94,7 +97,7 @@ xmrig::Pool::Pool(const char *host, uint16_t port, const char *user, const char
|
|||
m_pollInterval(kDefaultPollInterval),
|
||||
m_url(host, port, tls)
|
||||
{
|
||||
m_flags.set(FLAG_NICEHASH, nicehash);
|
||||
m_flags.set(FLAG_NICEHASH, nicehash || strstr(host, kNicehashHost));
|
||||
m_flags.set(FLAG_TLS, tls);
|
||||
}
|
||||
|
||||
|
@ -119,7 +122,7 @@ xmrig::Pool::Pool(const rapidjson::Value &object) :
|
|||
m_proxy = Json::getValue(object, kSOCKS5);
|
||||
|
||||
m_flags.set(FLAG_ENABLED, Json::getBool(object, kEnabled, true));
|
||||
m_flags.set(FLAG_NICEHASH, Json::getBool(object, kNicehash));
|
||||
m_flags.set(FLAG_NICEHASH, Json::getBool(object, kNicehash) || m_url.host().contains(kNicehashHost));
|
||||
m_flags.set(FLAG_TLS, Json::getBool(object, kTls) || m_url.isTLS());
|
||||
|
||||
if (m_daemon.isValid()) {
|
||||
|
|
|
@ -71,6 +71,7 @@ public:
|
|||
static const char *kTls;
|
||||
static const char *kUrl;
|
||||
static const char *kUser;
|
||||
static const char *kNicehashHost;
|
||||
|
||||
constexpr static int kKeepAliveTimeout = 60;
|
||||
constexpr static uint16_t kDefaultPort = 3333;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue