aboutsummaryrefslogtreecommitdiff
path: root/test/functional/test_framework/test_node.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/test_framework/test_node.py')
-rwxr-xr-xtest/functional/test_framework/test_node.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/test/functional/test_framework/test_node.py b/test/functional/test_framework/test_node.py
index 8b28064c46..34b458482a 100755
--- a/test/functional/test_framework/test_node.py
+++ b/test/functional/test_framework/test_node.py
@@ -168,7 +168,7 @@ class TestNode():
if 'dstaddr' not in kwargs:
kwargs['dstaddr'] = '127.0.0.1'
self.p2ps.append(p2p_conn)
- kwargs.update({'rpc': self.rpc, 'callback': p2p_conn})
+ kwargs.update({'callback': p2p_conn})
p2p_conn.add_connection(NodeConn(**kwargs))
return p2p_conn
@@ -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"""