mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-06-30 02:31:05 +02:00
qa: Avoid start/stop of the network thread mid-test
This commit is contained in:
@ -73,15 +73,11 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
self.setup_nodes()
|
||||
|
||||
def run_test(self):
|
||||
# Setup the p2p connections and start up the network thread.
|
||||
# Setup the p2p connections
|
||||
# test_node connects to node0 (not whitelisted)
|
||||
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||
# min_work_node connects to node1 (whitelisted)
|
||||
min_work_node = self.nodes[1].add_p2p_connection(P2PInterface())
|
||||
|
||||
network_thread_start()
|
||||
|
||||
# Test logic begins here
|
||||
test_node.wait_for_verack()
|
||||
min_work_node.wait_for_verack()
|
||||
|
||||
@ -204,10 +200,8 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
|
||||
self.nodes[0].disconnect_p2ps()
|
||||
self.nodes[1].disconnect_p2ps()
|
||||
network_thread_join()
|
||||
|
||||
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||
network_thread_start()
|
||||
test_node.wait_for_verack()
|
||||
|
||||
test_node.send_message(msg_block(block_h1f))
|
||||
@ -293,8 +287,6 @@ class AcceptBlockTest(BitcoinTestFramework):
|
||||
|
||||
self.nodes[0].disconnect_p2ps()
|
||||
test_node = self.nodes[0].add_p2p_connection(P2PInterface())
|
||||
|
||||
network_thread_start()
|
||||
test_node.wait_for_verack()
|
||||
|
||||
# We should have failed reorg and switched back to 290 (but have block 291)
|
||||
|
Reference in New Issue
Block a user