mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-11 03:53:22 +02:00
test: Use connect_nodes when connecting nodes in the test_framework
This commit is contained in:
@@ -54,6 +54,10 @@ class NetTest(BitcoinTestFramework):
|
||||
self.extra_args = [["-minrelaytxfee=0.00001000"],["-minrelaytxfee=0.00000500"]]
|
||||
|
||||
def run_test(self):
|
||||
self.log.info('Connect nodes both way')
|
||||
connect_nodes(self.nodes[0], 1)
|
||||
connect_nodes(self.nodes[1], 0)
|
||||
|
||||
self._test_connection_count()
|
||||
self._test_getnettotals()
|
||||
self._test_getnetworkinfo()
|
||||
@@ -105,7 +109,10 @@ class NetTest(BitcoinTestFramework):
|
||||
wait_until(lambda: self.nodes[0].getnetworkinfo()['connections'] == 0, timeout=3)
|
||||
|
||||
self.nodes[0].setnetworkactive(state=True)
|
||||
connect_nodes_bi(self.nodes, 0, 1)
|
||||
self.log.info('Connect nodes both way')
|
||||
connect_nodes(self.nodes[0], 1)
|
||||
connect_nodes(self.nodes[1], 0)
|
||||
|
||||
assert_equal(self.nodes[0].getnetworkinfo()['networkactive'], True)
|
||||
assert_equal(self.nodes[0].getnetworkinfo()['connections'], 2)
|
||||
|
||||
|
Reference in New Issue
Block a user