PoW init reordering
- inited by the worker thread on its own init, instead of when the imports are being evaluated - also got rid of windows-style newlines in OpenCL PoW
This commit is contained in:
parent
58b47bc6de
commit
a48dff3bee
|
@ -42,6 +42,7 @@ class singleWorker(threading.Thread, StoppableThread):
|
||||||
# QThread.__init__(self, parent)
|
# QThread.__init__(self, parent)
|
||||||
threading.Thread.__init__(self, name="singleWorker")
|
threading.Thread.__init__(self, name="singleWorker")
|
||||||
self.initStop()
|
self.initStop()
|
||||||
|
proofofwork.init()
|
||||||
|
|
||||||
def stopThread(self):
|
def stopThread(self):
|
||||||
try:
|
try:
|
||||||
|
|
|
@ -100,7 +100,7 @@ def do_opencl_pow(hash, target):
|
||||||
# logger.debug("Took %d tries.", progress)
|
# logger.debug("Took %d tries.", progress)
|
||||||
return output[0][0]
|
return output[0][0]
|
||||||
|
|
||||||
initCL()
|
#initCL()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
target = 54227212183L
|
target = 54227212183L
|
||||||
|
|
|
@ -237,6 +237,9 @@ def resetPoW():
|
||||||
# init
|
# init
|
||||||
def init():
|
def init():
|
||||||
global bitmsglib, bso, bmpow
|
global bitmsglib, bso, bmpow
|
||||||
|
|
||||||
|
openclpow.initCL()
|
||||||
|
|
||||||
if "win32" == sys.platform:
|
if "win32" == sys.platform:
|
||||||
if ctypes.sizeof(ctypes.c_voidp) == 4:
|
if ctypes.sizeof(ctypes.c_voidp) == 4:
|
||||||
bitmsglib = 'bitmsghash32.dll'
|
bitmsglib = 'bitmsghash32.dll'
|
||||||
|
@ -286,7 +289,5 @@ def init():
|
||||||
bmpow = None
|
bmpow = None
|
||||||
else:
|
else:
|
||||||
bmpow = None
|
bmpow = None
|
||||||
|
|
||||||
init()
|
|
||||||
if bmpow is None:
|
if bmpow is None:
|
||||||
buildCPoW()
|
buildCPoW()
|
||||||
|
|
Reference in New Issue
Block a user