From 63ac2b78464847633925c7cc455fe67c66f673d1 Mon Sep 17 00:00:00 2001 From: Gregor Robinson Date: Thu, 18 Jul 2013 11:13:57 +0100 Subject: [PATCH] Temporary workaround for hanging PoW. --- src/proofofwork.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/proofofwork.py b/src/proofofwork.py index f2c32c06..31eb060b 100644 --- a/src/proofofwork.py +++ b/src/proofofwork.py @@ -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) -- 2.45.1