Use fast PoW unless we're explicitly a frozen (binary) version of the code

This commit is contained in:
Grant T. Olson 2013-08-23 13:20:07 -04:00
parent 28b6b743e3
commit a20213f1e8
2 changed files with 7 additions and 2 deletions

View File

@ -4,7 +4,7 @@
import hashlib
from struct import unpack, pack
import sys
from shared import config
from shared import config, frozen
#import os
def _set_idle():
@ -71,7 +71,7 @@ def _doFastPoW(target, initialHash):
time.sleep(0.2)
def run(target, initialHash):
if 'linux' in sys.platform:
if not frozen:
return _doFastPoW(target, initialHash)
else:
return _doSafePoW(target, initialHash)

View File

@ -74,6 +74,11 @@ networkDefaultPayloadLengthExtraBytes = 14000 #To make sending short messages a
# namecoin integration to "namecoind".
namecoinDefaultRpcPort = "8336"
# When using py2exe or py2app, the variable frozen is added to the sys
# namespace. This can be used to setup a different code path for
# binary distributions vs source distributions.
frozen = getattr(sys,'frozen', None)
def isInSqlInventory(hash):
t = (hash,)
shared.sqlLock.acquire()