aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p-segwit.py
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2017-08-24 15:36:02 -0400
committerJohn Newbery <john@johnnewbery.com>2017-11-08 09:32:04 -0500
commit32ae82f5c3d51a66ad4deb84819809b890664245 (patch)
tree23e83cfed1f974a3a21df022ec1f207eeb645dae /test/functional/p2p-segwit.py
parent5e5725cc2b56d66510fd85d7ee3822e6df43cd24 (diff)
[tests] use TestNode p2p connection in tests
Diffstat (limited to 'test/functional/p2p-segwit.py')
-rwxr-xr-xtest/functional/p2p-segwit.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/test/functional/p2p-segwit.py b/test/functional/p2p-segwit.py
index 49de1a6e87..22da7f2db1 100755
--- a/test/functional/p2p-segwit.py
+++ b/test/functional/p2p-segwit.py
@@ -1868,19 +1868,12 @@ class SegWitTest(BitcoinTestFramework):
def run_test(self):
# Setup the p2p connections and start up the network thread.
- self.test_node = TestNode() # sets NODE_WITNESS|NODE_NETWORK
- self.old_node = TestNode() # only NODE_NETWORK
- self.std_node = TestNode() # for testing node1 (fRequireStandard=true)
-
- self.p2p_connections = [self.test_node, self.old_node]
-
- self.connections = []
- self.connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], self.test_node, services=NODE_NETWORK|NODE_WITNESS))
- self.connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], self.old_node, services=NODE_NETWORK))
- self.connections.append(NodeConn('127.0.0.1', p2p_port(1), self.nodes[1], self.std_node, services=NODE_NETWORK|NODE_WITNESS))
- self.test_node.add_connection(self.connections[0])
- self.old_node.add_connection(self.connections[1])
- self.std_node.add_connection(self.connections[2])
+ # self.test_node sets NODE_WITNESS|NODE_NETWORK
+ self.test_node = self.nodes[0].add_p2p_connection(TestNode(), services=NODE_NETWORK|NODE_WITNESS)
+ # self.old_node sets only NODE_NETWORK
+ self.old_node = self.nodes[0].add_p2p_connection(TestNode(), services=NODE_NETWORK)
+ # self.std_node is for testing node1 (fRequireStandard=true)
+ self.std_node = self.nodes[1].add_p2p_connection(TestNode(), services=NODE_NETWORK|NODE_WITNESS)
NetworkThread().start() # Start up network handling in another thread