merge bitcoin#22987: Fix "RuntimeError: Event loop is closed" on Windows

This commit is contained in:
Kittywhiskers Van Gogh 2021-09-15 18:33:43 +03:00
parent ba60d5459e
commit 7c03133be3
No known key found for this signature in database
GPG Key ID: 30CD0C065E5C4AAD

View File

@ -631,6 +631,8 @@ class NetworkThread(threading.Thread):
NetworkThread.listeners = {} NetworkThread.listeners = {}
NetworkThread.protos = {} NetworkThread.protos = {}
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
NetworkThread.network_event_loop = asyncio.new_event_loop() NetworkThread.network_event_loop = asyncio.new_event_loop()
def run(self): def run(self):