mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-10-10 19:43:13 +02:00
test: refactor: Inline adjust_bitcoin_conf_for_pre_17
This commit is contained in:
@@ -452,7 +452,7 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
assert_equal(len(binary), num_nodes)
|
||||
assert_equal(len(binary_cli), num_nodes)
|
||||
for i in range(num_nodes):
|
||||
self.nodes.append(TestNode(
|
||||
test_node_i = TestNode(
|
||||
i,
|
||||
get_datadir_path(self.options.tmpdir, i),
|
||||
chain=self.chain,
|
||||
@@ -470,7 +470,15 @@ class BitcoinTestFramework(metaclass=BitcoinTestMetaClass):
|
||||
start_perf=self.options.perf,
|
||||
use_valgrind=self.options.valgrind,
|
||||
descriptors=self.options.descriptors,
|
||||
))
|
||||
)
|
||||
self.nodes.append(test_node_i)
|
||||
if not test_node_i.version_is_at_least(170000):
|
||||
# adjust conf for pre 17
|
||||
conf_file = test_node_i.bitcoinconf
|
||||
with open(conf_file, 'r', encoding='utf8') as conf:
|
||||
conf_data = conf.read()
|
||||
with open(conf_file, 'w', encoding='utf8') as conf:
|
||||
conf.write(conf_data.replace('[regtest]', ''))
|
||||
|
||||
def start_node(self, i, *args, **kwargs):
|
||||
"""Start a bitcoind"""
|
||||
|
Reference in New Issue
Block a user