From c9b9ef51ee6b376d629264ac4056fc111c7b8b40 Mon Sep 17 00:00:00 2001 From: XMRig Date: Thu, 29 Feb 2024 09:38:47 +0700 Subject: [PATCH] #2800 Fixed donation with ghostrider algorithm for builds without KawPow algorithm. --- src/base/net/stratum/Client.cpp | 13 ++++--------- src/net/strategies/DonateStrategy.cpp | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/base/net/stratum/Client.cpp b/src/base/net/stratum/Client.cpp index 68122f93d..54246e723 100644 --- a/src/base/net/stratum/Client.cpp +++ b/src/base/net/stratum/Client.cpp @@ -1,7 +1,7 @@ /* XMRig * Copyright (c) 2019 jtgrassie - * Copyright (c) 2018-2023 SChernykh - * Copyright (c) 2016-2023 XMRig , + * Copyright (c) 2018-2024 SChernykh + * Copyright (c) 2016-2024 XMRig , * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -609,12 +609,7 @@ bool xmrig::Client::parseLogin(const rapidjson::Value &result, int *code) parseExtensions(result); - if (!result.HasMember("job")) { - *code = 2; - return false; - } - - const bool rc = parseJob(result["job"], code); + const bool rc = parseJob(Json::getObject(result, "job"), code); m_jobs = 0; return rc; @@ -849,7 +844,7 @@ void xmrig::Client::parseResponse(int64_t id, const rapidjson::Value &result, co m_listener->onLoginSuccess(this); if (m_job.isValid()) { - m_listener->onJobReceived(this, m_job, result["job"]); + m_listener->onJobReceived(this, m_job, Json::getObject(result, "job")); } return; diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index 03447a017..1f647ae41 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -63,7 +63,7 @@ xmrig::DonateStrategy::DonateStrategy(Controller *controller, IStrategyListener keccak(reinterpret_cast(user.data()), user.size(), hash); Cvt::toHex(m_userId, sizeof(m_userId), hash, 32); -# ifdef XMRIG_ALGO_KAWPOW +# if defined XMRIG_ALGO_KAWPOW || defined XMRIG_ALGO_GHOSTRIDER constexpr Pool::Mode mode = Pool::MODE_AUTO_ETH; # else constexpr Pool::Mode mode = Pool::MODE_POOL;