Changeset View
Changeset View
Standalone View
Standalone View
test/functional/sendheaders.py
Show First 20 Lines • Show All 217 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Setup the p2p connections and start up the network thread. | # Setup the p2p connections and start up the network thread. | ||||
inv_node = TestNode() | inv_node = TestNode() | ||||
test_node = TestNode() | test_node = TestNode() | ||||
self.p2p_connections = [inv_node, test_node] | self.p2p_connections = [inv_node, test_node] | ||||
connections = [] | connections = [] | ||||
connections.append( | connections.append( | ||||
NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], inv_node)) | NodeConn('127.0.0.1', self.p2p_port(0), self.nodes[0], inv_node)) | ||||
# Set nServices to 0 for test_node, so no block download will occur outside of | # Set nServices to 0 for test_node, so no block download will occur outside of | ||||
# direct fetching | # direct fetching | ||||
connections.append(NodeConn('127.0.0.1', p2p_port( | connections.append(NodeConn('127.0.0.1', self.p2p_port( | ||||
0), self.nodes[0], test_node, services=0)) | 0), self.nodes[0], test_node, services=0)) | ||||
inv_node.add_connection(connections[0]) | inv_node.add_connection(connections[0]) | ||||
test_node.add_connection(connections[1]) | test_node.add_connection(connections[1]) | ||||
NetworkThread().start() # Start up network handling in another thread | NetworkThread().start() # Start up network handling in another thread | ||||
# Test logic begins here | # Test logic begins here | ||||
inv_node.wait_for_verack() | inv_node.wait_for_verack() | ||||
▲ Show 20 Lines • Show All 351 Lines • Show Last 20 Lines |