File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
test/functional/test_framework Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,10 @@ class P2PConnection(asyncore.dispatcher):
69
69
sub-classed and the on_message() callback overridden."""
70
70
71
71
def __init__ (self ):
72
+ # All P2PConnections must be created before starting the NetworkThread.
73
+ # assert that the network thread is not running.
74
+ assert not network_thread_running ()
75
+
72
76
super ().__init__ (map = mininode_socket_map )
73
77
74
78
def peer_connect (self , dstaddr , dstport , net = "regtest" ):
@@ -418,6 +422,9 @@ def run(self):
418
422
419
423
def network_thread_start ():
420
424
"""Start the network thread."""
425
+ # Only one network thread may run at a time
426
+ assert not network_thread_running ()
427
+
421
428
NetworkThread ().start ()
422
429
423
430
def network_thread_running ():
You can’t perform that action at this time.
0 commit comments