mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-11 09:22:48 -05:00
Only save config if threads were automatically calculated
This commit is contained in:
@@ -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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user