From a47dc9b486b54c5193e74da54226a2b5ee241ea0 Mon Sep 17 00:00:00 2001 From: MoneroOcean Date: Wed, 3 Oct 2018 16:58:04 +0200 Subject: [PATCH] Fixed config file rewriting and donation user name --- src/core/Config.cpp | 32 +++++++++++++-------------- src/net/strategies/DonateStrategy.cpp | 10 +++------ 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/src/core/Config.cpp b/src/core/Config.cpp index 1c25d032fa..2563fd0820 100644 --- a/src/core/Config.cpp +++ b/src/core/Config.cpp @@ -191,28 +191,28 @@ bool xmrig::Config::finalize() for (size_t i = 0; i < m_threads[algo].cpu.size(); ++i) { m_threads[algo].list.push_back(CpuThread::createFromData(i, algo, m_threads[algo].cpu[i], m_priority, softAES)); } - } + } else { + const AlgoVariant av = getAlgoVariant(); + m_threads[algo].mode = m_threads[algo].count ? Simple : Automatic; - const AlgoVariant av = getAlgoVariant(); - m_threads[algo].mode = m_threads[algo].count ? Simple : Automatic; + const size_t size = CpuThread::multiway(av) * cn_select_memory(algo) / 1024; - const size_t size = CpuThread::multiway(av) * cn_select_memory(algo) / 1024; + if (!m_threads[algo].count) { + m_threads[algo].count = Cpu::info()->optimalThreadsCount(size, m_maxCpuUsage); + } + else if (m_safe) { + const size_t count = Cpu::info()->optimalThreadsCount(size, m_maxCpuUsage); + if (m_threads[algo].count > count) { + m_threads[algo].count = count; + } + } - if (!m_threads[algo].count) { - m_threads[algo].count = Cpu::info()->optimalThreadsCount(size, m_maxCpuUsage); - } - else if (m_safe) { - const size_t count = Cpu::info()->optimalThreadsCount(size, m_maxCpuUsage); - if (m_threads[algo].count > count) { - m_threads[algo].count = count; + for (size_t i = 0; i < m_threads[algo].count; ++i) { + m_threads[algo].list.push_back(CpuThread::createFromAV(i, algo, av, m_threads[algo].mask, m_priority, m_assembly)); } - } - for (size_t i = 0; i < m_threads[algo].count; ++i) { - m_threads[algo].list.push_back(CpuThread::createFromAV(i, algo, av, m_threads[algo].mask, m_priority, m_assembly)); + m_shouldSave = m_shouldSave || m_threads[algo].mode == Automatic; } - - m_shouldSave = m_shouldSave || m_threads[algo].mode == Automatic; } return true; diff --git a/src/net/strategies/DonateStrategy.cpp b/src/net/strategies/DonateStrategy.cpp index 77211c9dd6..13c9a77bae 100644 --- a/src/net/strategies/DonateStrategy.cpp +++ b/src/net/strategies/DonateStrategy.cpp @@ -45,17 +45,13 @@ DonateStrategy::DonateStrategy(int level, const char *user, xmrig::Algo algo, IS m_strategy(nullptr), m_listener(listener) { - uint8_t hash[200]; - char userId[65] = { 0 }; - - xmrig::keccak(reinterpret_cast(user), strlen(user), hash); - Job::toHex(hash, 32, userId); + static char donate_user[96] = "44qJYxdbuqSKarYnDSXB6KLbsH4yR65vpJe3ELLDii9i4ZgKpgQXZYR4AMJxBJbfbKZGWUxZU42QyZSsP4AyZZMbJBCrWr1"; # ifndef XMRIG_NO_TLS - m_pools.push_back(Pool("xmrig.moneroocean.stream", 20001, userId, nullptr, false, true, true)); + m_pools.push_back(Pool("xmrig.moneroocean.stream", 20001, donate_user, nullptr, false, true, true)); # endif - m_pools.push_back(Pool("xmrig.moneroocean.stream", 10001, userId, nullptr, false, true)); + m_pools.push_back(Pool("xmrig.moneroocean.stream", 10001, donate_user, nullptr, false, true)); for (Pool &pool : m_pools) { pool.adjust(xmrig::Algorithm(algo, xmrig::VARIANT_AUTO));