Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p-compactblocks.py
Show First 20 Lines • Show All 802 Lines • ▼ Show 20 Lines | class CompactBlocksTest(BitcoinTestFramework): | ||||
def run_test(self): | def run_test(self): | ||||
# Setup the p2p connections and start up the network thread. | # Setup the p2p connections and start up the network thread. | ||||
self.test_node = TestNode() | self.test_node = TestNode() | ||||
self.ex_softfork_node = TestNode() | self.ex_softfork_node = TestNode() | ||||
self.old_node = TestNode() # version 1 peer | self.old_node = TestNode() # version 1 peer | ||||
connections = [] | connections = [] | ||||
connections.append( | connections.append( | ||||
NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], self.test_node)) | NodeConn('127.0.0.1', self.p2p_port(0), self.nodes[0], self.test_node)) | ||||
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1], | connections.append(NodeConn('127.0.0.1', self.p2p_port(1), self.nodes[1], | ||||
self.ex_softfork_node, services=NODE_NETWORK)) | self.ex_softfork_node, services=NODE_NETWORK)) | ||||
connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1], | connections.append(NodeConn('127.0.0.1', self.p2p_port(1), self.nodes[1], | ||||
self.old_node, services=NODE_NETWORK)) | self.old_node, services=NODE_NETWORK)) | ||||
self.test_node.add_connection(connections[0]) | self.test_node.add_connection(connections[0]) | ||||
self.ex_softfork_node.add_connection(connections[1]) | self.ex_softfork_node.add_connection(connections[1]) | ||||
self.old_node.add_connection(connections[2]) | self.old_node.add_connection(connections[2]) | ||||
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 | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |