Skip to content

Commit

Permalink
Fixed config file rewriting and donation user name
Browse files Browse the repository at this point in the history
  • Loading branch information
MoneroOcean committed Oct 3, 2018
1 parent 3faf122 commit a47dc9b
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
32 changes: 16 additions & 16 deletions src/core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 3 additions & 7 deletions src/net/strategies/DonateStrategy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const uint8_t *>(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));
Expand Down

0 comments on commit a47dc9b

Please sign in to comment.