test: Use connect_nodes when connecting nodes in the test_framework

This commit is contained in:
MarcoFalke
2019-09-16 09:22:49 -04:00
parent 1111bb91f5
commit faaee1e39a
5 changed files with 38 additions and 5 deletions

View File

@ -5,9 +5,15 @@
"""Test the listsincelast RPC."""
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, assert_array_result, assert_raises_rpc_error
from test_framework.util import (
assert_array_result,
assert_equal,
assert_raises_rpc_error,
connect_nodes,
)
class ListSinceBlockTest (BitcoinTestFramework):
class ListSinceBlockTest(BitcoinTestFramework):
def set_test_params(self):
self.num_nodes = 4
self.setup_clean_chain = True
@ -16,6 +22,9 @@ class ListSinceBlockTest (BitcoinTestFramework):
self.skip_if_no_wallet()
def run_test(self):
# All nodes are in IBD from genesis, so they'll need the miner (node2) to be an outbound connection, or have
# only one connection. (See fPreferredDownload in net_processing)
connect_nodes(self.nodes[1], 2)
self.nodes[2].generate(101)
self.sync_all()