From 48dae8fadf4e88c5dc1a92248a62d3662533d82e Mon Sep 17 00:00:00 2001 From: ThomasV Date: Wed, 11 Apr 2018 11:39:59 +0200 Subject: [PATCH] fix asyncio loop --- lib/network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/network.py b/lib/network.py index 5f66e7d2..7e13bd47 100644 --- a/lib/network.py +++ b/lib/network.py @@ -1081,6 +1081,7 @@ class Network(util.DaemonThread): privkey = b"\x21"*32 + b"\x01" peer = Peer(privkey, host, port, pubkey) self.futures.append(asyncio.run_coroutine_threadsafe(peer.main_loop(loop), loop)) + loop.run_forever() threading.Thread(target=asyncioThread).start() networkAndWalletLock.acquire() @@ -1093,7 +1094,7 @@ class Network(util.DaemonThread): networkAndWalletLock.release() networkAndWalletLock.acquire() # cancel tasks - [f.cancel for f in self.futures] + [f.cancel() for f in self.futures] loop.stop() if loop.is_running(): time.sleep(0.1) try: