Merge pull request #2738 from SChernykh/dev

More GhostRider fixes
This commit is contained in:
xmrig 2021-11-28 18:19:08 +07:00 committed by GitHub
commit c40f1f9f66
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 6 deletions

View file

@ -244,7 +244,7 @@ else()
endif()
if (WITH_KAWPOW)
if (WITH_KAWPOW OR WITH_GHOSTRIDER)
list(APPEND HEADERS_BASE
src/base/net/stratum/AutoClient.h
src/base/net/stratum/EthStratumClient.h

View file

@ -213,12 +213,13 @@ void xmrig::EthStratumClient::parseNotification(const char *method, const rapidj
return;
}
if (!arr[0].IsDouble()) {
if (!arr[0].IsDouble() && !arr[0].IsUint64()) {
LOG_ERR("%s " RED("invalid mining.set_difficulty notification: difficulty is not a number"), tag());
return;
}
m_nextDifficulty = static_cast<uint64_t>(ceil(arr[0].GetDouble() * 65536.0));
const double diff = arr[0].IsDouble() ? arr[0].GetDouble() : arr[0].GetUint64();
m_nextDifficulty = static_cast<uint64_t>(ceil(diff * 65536.0));
}
# endif

View file

@ -31,7 +31,7 @@
#include "base/kernel/Platform.h"
#include "base/net/stratum/Client.h"
#ifdef XMRIG_ALGO_KAWPOW
#if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
# include "base/net/stratum/AutoClient.h"
# include "base/net/stratum/EthStratumClient.h"
#endif
@ -218,7 +218,7 @@ xmrig::IClient *xmrig::Pool::createClient(int id, IClientListener *listener) con
IClient *client = nullptr;
if (m_mode == MODE_POOL) {
# ifdef XMRIG_ALGO_KAWPOW
# if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
const uint32_t f = m_algorithm.family();
if ((f == Algorithm::KAWPOW) || (f == Algorithm::GHOSTRIDER) || (m_coin == Coin::RAVEN)) {
client = new EthStratumClient(id, Platform::userAgent(), listener);
@ -237,7 +237,7 @@ xmrig::IClient *xmrig::Pool::createClient(int id, IClientListener *listener) con
client = new SelfSelectClient(id, Platform::userAgent(), listener, m_submitToOrigin);
}
# endif
# ifdef XMRIG_ALGO_KAWPOW
# if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER
else if (m_mode == MODE_AUTO_ETH) {
client = new AutoClient(id, Platform::userAgent(), listener);
}