aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2017-11-08 16:28:17 -0500
committerMarcoFalke <falke.marco@gmail.com>2017-11-13 15:27:10 -0500
commitfaaa7db25e94cf02818865e3d27707d6acaa1e25 (patch)
tree9756d0680de4fc9bda2394a24ff28fc3f09e1401 /test/functional/test_framework
parentf7388e93d3dd91a90239aedac4ec58404f103a2e (diff)
downloadbitcoin-faaa7db25e94cf02818865e3d27707d6acaa1e25.tar.xz
qa: Only allow disconnecting all NodeConns
Diffstat (limited to 'test/functional/test_framework')
-rwxr-xr-xtest/functional/test_framework/test_node.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 8b28064c46..73018ee5da 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -182,13 +182,14 @@ class TestNode():
assert self.p2ps, "No p2p connection"
return self.p2ps[0]
- def disconnect_p2p(self, index=0):
- """Close the p2p connection to the node."""
- # Connection could have already been closed by other end. Calling disconnect_p2p()
- # on an already disconnected p2p connection is not an error.
- if self.p2ps[index].connection is not None:
- self.p2ps[index].connection.disconnect_node()
- del self.p2ps[index]
+ def disconnect_p2ps(self):
+ """Close all p2p connections to the node."""
+ for p in self.p2ps:
+ # Connection could have already been closed by other end.
+ if p.connection is not None:
+ p.connection.disconnect_node()
+ self.p2ps = []
+
class TestNodeCLI():
"""Interface to bitcoin-cli for an individual node"""