Use fast POW unless frozen #461
|
@ -4,7 +4,7 @@
|
||||||
import hashlib
|
import hashlib
|
||||||
from struct import unpack, pack
|
from struct import unpack, pack
|
||||||
import sys
|
import sys
|
||||||
from shared import config
|
from shared import config, frozen
|
||||||
#import os
|
#import os
|
||||||
|
|
||||||
def _set_idle():
|
def _set_idle():
|
||||||
|
@ -71,7 +71,7 @@ def _doFastPoW(target, initialHash):
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
|
|
||||||
def run(target, initialHash):
|
def run(target, initialHash):
|
||||||
if 'linux' in sys.platform:
|
if frozen == "macosx_app" or not frozen:
|
||||||
return _doFastPoW(target, initialHash)
|
return _doFastPoW(target, initialHash)
|
||||||
else:
|
else:
|
||||||
return _doSafePoW(target, initialHash)
|
return _doSafePoW(target, initialHash)
|
||||||
|
|
|
@ -79,6 +79,11 @@ networkDefaultPayloadLengthExtraBytes = 14000 #To make sending short messages a
|
||||||
# namecoin integration to "namecoind".
|
# namecoin integration to "namecoind".
|
||||||
namecoinDefaultRpcPort = "8336"
|
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):
|
def isInSqlInventory(hash):
|
||||||
t = (hash,)
|
t = (hash,)
|
||||||
shared.sqlLock.acquire()
|
shared.sqlLock.acquire()
|
||||||
|
|
Reference in New Issue
Block a user