mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-03 20:21:34 +02:00
qa: Avoid start/stop of the network thread mid-test
This commit is contained in:
@ -9,7 +9,7 @@ and that it responds to getdata requests for blocks correctly:
|
||||
- send a block within 288 + 2 of the tip
|
||||
- disconnect peers who request blocks older than that."""
|
||||
from test_framework.messages import CInv, msg_getdata, msg_verack
|
||||
from test_framework.mininode import NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS, P2PInterface, wait_until, mininode_lock, network_thread_start, network_thread_join
|
||||
from test_framework.mininode import NODE_BLOOM, NODE_NETWORK_LIMITED, NODE_WITNESS, P2PInterface, wait_until, mininode_lock
|
||||
from test_framework.test_framework import BitcoinTestFramework
|
||||
from test_framework.util import assert_equal, disconnect_nodes, connect_nodes_bi, sync_blocks
|
||||
|
||||
@ -48,7 +48,6 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
|
||||
def run_test(self):
|
||||
node = self.nodes[0].add_p2p_connection(P2PIgnoreInv())
|
||||
network_thread_start()
|
||||
node.wait_for_verack()
|
||||
|
||||
expected_services = NODE_BLOOM | NODE_WITNESS | NODE_NETWORK_LIMITED
|
||||
@ -74,9 +73,7 @@ class NodeNetworkLimitedTest(BitcoinTestFramework):
|
||||
|
||||
self.log.info("Check local address relay, do a fresh connection.")
|
||||
self.nodes[0].disconnect_p2ps()
|
||||
network_thread_join()
|
||||
node1 = self.nodes[0].add_p2p_connection(P2PIgnoreInv())
|
||||
network_thread_start()
|
||||
node1.wait_for_verack()
|
||||
node1.send_message(msg_verack())
|
||||
|
||||
|
Reference in New Issue
Block a user