mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-11 22:50:59 +01:00
Remove network_event_loop instance in close()
The asyncio.new_event_loop() instance is now removed from the NetworkThread class during shutdown. This enables a NetworkThread instance to be restarted after being closed. The current NetworkThread class guards against an existing new_event_loop during initialization.
This commit is contained in:
@@ -478,7 +478,8 @@ class NetworkThread(threading.Thread):
|
|||||||
wait_until(lambda: not self.network_event_loop.is_running(), timeout=timeout)
|
wait_until(lambda: not self.network_event_loop.is_running(), timeout=timeout)
|
||||||
self.network_event_loop.close()
|
self.network_event_loop.close()
|
||||||
self.join(timeout)
|
self.join(timeout)
|
||||||
|
# Safe to remove event loop.
|
||||||
|
NetworkThread.network_event_loop = None
|
||||||
|
|
||||||
class P2PDataStore(P2PInterface):
|
class P2PDataStore(P2PInterface):
|
||||||
"""A P2P data store class.
|
"""A P2P data store class.
|
||||||
|
|||||||
Reference in New Issue
Block a user