From 0e7c1aa48110df57bc327fbf40df74e74c98c7b6 Mon Sep 17 00:00:00 2001 From: SChernykh Date: Thu, 14 Jul 2022 11:39:19 +0200 Subject: [PATCH] SideChain: stricter checks for number of threads --- src/side_chain.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/side_chain.cpp b/src/side_chain.cpp index 6453e32..23805e0 100644 --- a/src/side_chain.cpp +++ b/src/side_chain.cpp @@ -167,8 +167,9 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name) --numThreads; } - // Use no more than 8 threads - numThreads = std::min(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");