More GhostRider fixes
- Fixed "difficulty is not a number" when diff is high on some pools - Fixed GhostRider compilation when WITH_KAWPOW=OFF
This commit is contained in:
parent
c6292ce9ee
commit
15e5052dd0
3 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue