From 549d91dc6827b805c98ceb7544f9bf61516b2fc9 Mon Sep 17 00:00:00 2001 From: mailchuck Date: Sun, 29 Nov 2015 19:14:26 +0100 Subject: [PATCH] Re-disable windows SMP frozen support The recommended workaround didn't work. --- src/bitmessagemain.py | 2 -- src/proofofwork.py | 9 +++++++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/bitmessagemain.py b/src/bitmessagemain.py index b124e141..aba251f9 100755 --- a/src/bitmessagemain.py +++ b/src/bitmessagemain.py @@ -18,7 +18,6 @@ import singleton import os import socket import ctypes -from multiprocessing import Process, freeze_support from struct import pack import sys from subprocess import call @@ -266,7 +265,6 @@ class Main: return {'address':address,'port':port} if __name__ == "__main__": - freeze_support() mainprogram = Main() mainprogram.start() diff --git a/src/proofofwork.py b/src/proofofwork.py index 8ab04820..8441bdeb 100644 --- a/src/proofofwork.py +++ b/src/proofofwork.py @@ -151,6 +151,15 @@ def run(target, initialHash): return _doCPoW(target, initialHash) except: pass # fallback + if frozen == "macosx_app" or not frozen: + # on my (Peter Surda) Windows 10, Windows Defender + # does not like this and fights with PyBitmessage + # over CPU, resulting in very slow PoW + # added on 2015-11-29: multiprocesing.freeze_support() doesn't help + try: + return _doFastPoW(target, initialHash) + except: + pass #fallback try: return _doFastPoW(target, initialHash) except: