Only save config if threads were automatically calculated

This commit is contained in:
MoneroOcean 2018-08-04 11:40:40 +02:00
parent c33802280e
commit 2979b2c872

View file

@ -198,19 +198,19 @@ bool xmrig::Config::finalize()
if (!m_threads[pa].count) { if (!m_threads[pa].count) {
m_threads[pa].count = Cpu::optimalThreadsCount(size, m_maxCpuUsage); m_threads[pa].count = Cpu::optimalThreadsCount(size, m_maxCpuUsage);
m_shouldSave = true;
} }
else if (m_safe) { else if (m_safe) {
const size_t count = Cpu::optimalThreadsCount(size, m_maxCpuUsage); const size_t count = Cpu::optimalThreadsCount(size, m_maxCpuUsage);
if (m_threads[pa].count > count) { if (m_threads[pa].count > count) {
m_threads[pa].count = count; m_threads[pa].count = count;
m_shouldSave = true;
} }
} }
for (size_t i = 0; i < m_threads[pa].count; ++i) { for (size_t i = 0; i < m_threads[pa].count; ++i) {
m_threads[pa].list.push_back(CpuThread::createFromAV(i, xmrig::Algorithm(pa).algo(), av, m_threads[pa].mask, m_priority)); m_threads[pa].list.push_back(CpuThread::createFromAV(i, xmrig::Algorithm(pa).algo(), av, m_threads[pa].mask, m_priority));
} }
m_shouldSave = true;
} }
} }