aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p-versionbits-warning.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-versionbits-warning.py
parent5e5725cc2b56d66510fd85d7ee3822e6df43cd24 (diff)
downloadbitcoin-32ae82f5c3d51a66ad4deb84819809b890664245.tar.xz
[tests] use TestNode p2p connection in tests
Diffstat (limited to 'test/functional/p2p-versionbits-warning.py')
-rwxr-xr-xtest/functional/p2p-versionbits-warning.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/test/functional/p2p-versionbits-warning.py b/test/functional/p2p-versionbits-warning.py
index f9bef2580a..464ca5a312 100755
--- a/test/functional/p2p-versionbits-warning.py
+++ b/test/functional/p2p-versionbits-warning.py
@@ -64,16 +64,12 @@ class VersionBitsWarningTest(BitcoinTestFramework):
def run_test(self):
# Setup the p2p connection and start up the network thread.
- test_node = TestNode()
-
- connections = []
- connections.append(NodeConn('127.0.0.1', p2p_port(0), self.nodes[0], test_node))
- test_node.add_connection(connections[0])
+ self.nodes[0].add_p2p_connection(TestNode())
NetworkThread().start() # Start up network handling in another thread
# Test logic begins here
- test_node.wait_for_verack()
+ self.nodes[0].p2p.wait_for_verack()
# 1. Have the node mine one period worth of blocks
self.nodes[0].generate(VB_PERIOD)
@@ -81,7 +77,7 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# 2. Now build one period of blocks on the tip, with < VB_THRESHOLD
# blocks signaling some unknown bit.
nVersion = VB_TOP_BITS | (1<<VB_UNKNOWN_BIT)
- self.send_blocks_with_version(test_node, VB_THRESHOLD-1, nVersion)
+ self.send_blocks_with_version(self.nodes[0].p2p, VB_THRESHOLD-1, nVersion)
# Fill rest of period with regular version blocks
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD + 1)
@@ -92,7 +88,7 @@ class VersionBitsWarningTest(BitcoinTestFramework):
# 3. Now build one period of blocks with >= VB_THRESHOLD blocks signaling
# some unknown bit
- self.send_blocks_with_version(test_node, VB_THRESHOLD, nVersion)
+ self.send_blocks_with_version(self.nodes[0].p2p, VB_THRESHOLD, nVersion)
self.nodes[0].generate(VB_PERIOD - VB_THRESHOLD)
# Might not get a versionbits-related alert yet, as we should
# have gotten a different alert due to more than 51/100 blocks