upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
authorbitflash-maintainer <noreply@bitflash.invalid>2026-08-08 05:59:00 +0000
committerbitflash-maintainer <noreply@bitflash.invalid>2026-08-19 22:48:26 +0000
commit0de61316dc3e30c621cf48194809ea9b5cccc81f (patch)
tree875b65068f2033c0347cc50f9ec61cc96105560a /src/main.cpp
parent9ac0d2d26cde1b66f5f9b712fa8087209791c352 (diff)
participant: honor explicit /hashthreads=1 (floor of 2 only in auto mode)
The min-2-threads floor applied even when the user explicitly asked for 1 thread, so /hashthreads=1 silently spawned 2. (cherry picked from commit a67b9e84f4f7607d307081b4a9873f5d9e78cf8a)
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 69d9d30..f84f209 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3814,8 +3814,11 @@ connected:
3814 // ------------------------------------------------------------------ 3814 // ------------------------------------------------------------------
3815 int nWorkers = nHashThreads > 0 ? nHashThreads 3815 int nWorkers = nHashThreads > 0 ? nHashThreads
3816 : (int)std::thread::hardware_concurrency(); 3816 : (int)std::thread::hardware_concurrency();
3817 if (nWorkers < 2) nWorkers = 2; 3817 if (nHashThreads <= 0) {
3818 if (nHashThreads <= 0) nWorkers -= 1; // leave one core for node + I/O threads 3818 if (nWorkers < 2) nWorkers = 2;
3819 nWorkers -= 1; // leave one core for node + I/O threads
3820 }
3821 // explicit /hashthreads=N is honored exactly (including 1)
3819 ParticipantJobShared jobShared; 3822 ParticipantJobShared jobShared;
3820 std::vector<ParticipantShareHit> shareHits; 3823 std::vector<ParticipantShareHit> shareHits;
3821 std::mutex shareHitsMtx; 3824 std::mutex shareHitsMtx;