SideChain: stricter checks for number of threads

This commit is contained in:
SChernykh 2022-07-14 11:39:19 +02:00
parent 7d5ff13f75
commit 0e7c1aa481

View file

@ -167,8 +167,9 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
--numThreads;
}
// Use no more than 8 threads
numThreads = std::min<uint32_t>(numThreads, 8);
// Use between 1 and 8 threads
if (numThreads < 1) numThreads = 1;
if (numThreads > 8) numThreads = 8;
LOGINFO(4, "running " << numThreads << " pre-calculation workers");