Skip to content

Commit 074c6b2

Browse files
jachiangPiRK
authored andcommitted
Remove network_event_loop instance in close()
Summary: > 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 is a backport of Core [[bitcoin/bitcoin#17288 | PR17288]] [1/7] bitcoin/bitcoin@ede8b76 Test Plan: `ninja && ninja check-functional` Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien Differential Revision: https://reviews.bitcoinabc.org/D8241
1 parent 84f2368 commit 074c6b2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

test/functional/test_framework/mininode.py

+2
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,8 @@ def close(self, timeout=10):
571571
timeout=timeout)
572572
self.network_event_loop.close()
573573
self.join(timeout)
574+
# Safe to remove event loop.
575+
NetworkThread.network_event_loop = None
574576

575577

576578
class P2PDataStore(P2PInterface):

0 commit comments

Comments
 (0)