Temporary workaround for hanging PoW.

This commit is contained in:
Gregor Robinson 2013-07-18 11:13:57 +01:00
parent 5f10b6b7f2
commit 63ac2b7846

View File

@ -2,10 +2,12 @@
#import time
#from multiprocessing import Pool, cpu_count
import hashlib
#import os
from struct import unpack, pack
import sys
from debug import logger
from shared import config
#import os
def _set_idle():
if 'linux' in sys.platform:
@ -52,7 +54,9 @@ def _doFastPoW(target, initialHash):
maxCores = 99999
if pool_size > maxCores:
pool_size = maxCores
logger.debug('Creating POW pool with %s workers.' % (pool_size))
pool = Pool(processes=pool_size)
logger.debug('Created POW pool.')
result = []
for i in range(pool_size):
result.append(pool.apply_async(_pool_worker, args = (i, initialHash, target, pool_size)))
@ -72,6 +76,8 @@ def _doFastPoW(target, initialHash):
def run(target, initialHash):
if 'linux' in sys.platform:
return _doFastPoW(target, initialHash)
logger.debug('calling _doSafePoW as a TEMPORARY fix.')
return _doSafePoW(target, initialHash)
#return _doFastPoW(target, initialHash)
else:
return _doSafePoW(target, initialHash)