Even if we're on a platform that supports fast PoW calculation, we should use safe PoWs when we're only utilizing a single core

This commit is contained in:
Grant T. Olson 2013-08-22 12:45:24 -04:00
parent 28b6b743e3
commit e65fc0eb4d

View File

@ -52,6 +52,10 @@ def _doFastPoW(target, initialHash):
maxCores = 99999 maxCores = 99999
if pool_size > maxCores: if pool_size > maxCores:
pool_size = maxCores pool_size = maxCores
if pool_size == 1: # Don't mess around with multiprocessing on a single core machine
return _doSafePoW(target, initialHash)
pool = Pool(processes=pool_size) pool = Pool(processes=pool_size)
result = [] result = []
for i in range(pool_size): for i in range(pool_size):