From f4dadfd90b59ffae78df297c19dba72c87582acd Mon Sep 17 00:00:00 2001 From: XMRig Date: Wed, 5 Jul 2017 07:54:21 +0300 Subject: [PATCH] Improve nicehash detection. --- src/net/Job.cpp | 10 +++++++++- src/net/strategies/DonateStrategy.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/net/Job.cpp b/src/net/Job.cpp index cda6c9ae..0ec788a4 100644 --- a/src/net/Job.cpp +++ b/src/net/Job.cpp @@ -82,7 +82,15 @@ bool Job::setBlob(const char *blob) return false; } - return fromHex(blob, m_size * 2, m_blob); + if (!fromHex(blob, m_size * 2, m_blob)) { + return false; + } + + if (*nonce() != 0 && !m_nicehash) { + m_nicehash = true; + } + + return true; } diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index fb7b6a67..6c9d5e3a 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -34,7 +34,7 @@ DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) : m_idleTime((100 - Options::i()->donateLevel()) * 60 * 1000), m_listener(listener) { - Url *url = new Url("donate.xmrig.com", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 3333 : 443, Options::i()->pools().front()->user()); + Url *url = new Url("donate2.xmrig.com", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 3333 : 443, Options::i()->pools().front()->user()); m_client = new Client(-1, agent, this); m_client->setUrl(url);