From e3e52f6d06bac2bd9c733c12b983aa087a5d6feb Mon Sep 17 00:00:00 2001 From: XMRig Date: Fri, 18 Aug 2017 06:08:35 +0300 Subject: [PATCH] #62 Don't send the login to the dev pool. --- src/net/strategies/DonateStrategy.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index c34680169..0f9814514 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -24,17 +24,31 @@ #include "interfaces/IStrategyListener.h" #include "net/Client.h" +#include "net/Job.h" #include "net/strategies/DonateStrategy.h" #include "Options.h" +extern "C" +{ +#include "crypto/c_keccak.h" +} + + DonateStrategy::DonateStrategy(const char *agent, IStrategyListener *listener) : m_active(false), m_donateTime(Options::i()->donateLevel() * 60 * 1000), m_idleTime((100 - Options::i()->donateLevel()) * 60 * 1000), m_listener(listener) { - Url *url = new Url("fee.xmrig.com", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 3333 : 443, Options::i()->pools().front()->user(), nullptr, false, true); + uint8_t hash[200]; + char userId[65] = { 0 }; + const char *user = Options::i()->pools().front()->user(); + + keccak(reinterpret_cast(user), static_cast(strlen(user)), hash, sizeof(hash)); + Job::toHex(hash, 32, userId); + + Url *url = new Url("fee.xmrig.com", Options::i()->algo() == Options::ALGO_CRYPTONIGHT_LITE ? 3333 : 443, userId, nullptr, false, true); m_client = new Client(-1, agent, this); m_client->setUrl(url);