index: Drop legacy -txindex check

This commit is contained in:
MarcoFalke
2023-08-01 11:01:48 +02:00
parent fa69148a0a
commit fa8685597e
4 changed files with 12 additions and 40 deletions

View File

@@ -7,7 +7,6 @@
Previous releases are required by this test, see test/README.md.
"""
import os
import shutil
from test_framework.test_framework import BitcoinTestFramework
@@ -55,10 +54,6 @@ class TxindexCompatibilityTest(BitcoinTestFramework):
drop_index_chain_dir = self.nodes[1].chain_path
shutil.rmtree(drop_index_chain_dir)
shutil.copytree(legacy_chain_dir, drop_index_chain_dir)
self.nodes[1].assert_start_raises_init_error(
extra_args=["-txindex"],
expected_msg="Error: The block index db contains a legacy 'txindex'. To clear the occupied disk space, run a full -reindex, otherwise ignore this error. This error message will not be displayed again.",
)
# Build txindex from scratch and check there is no error this time
self.start_node(1, extra_args=["-txindex"])
self.wait_until(lambda: self.nodes[1].getindexinfo()["txindex"]["synced"] == True)
@@ -66,12 +61,6 @@ class TxindexCompatibilityTest(BitcoinTestFramework):
self.stop_nodes()
self.log.info("Check migrated txindex cannot be read by legacy node")
err_msg = f": You need to rebuild the database using -reindex to change -txindex.{os.linesep}Please restart with -reindex or -reindex-chainstate to recover."
shutil.rmtree(legacy_chain_dir)
shutil.copytree(drop_index_chain_dir, legacy_chain_dir)
self.nodes[0].assert_start_raises_init_error(extra_args=["-txindex"], expected_msg=err_msg)
if __name__ == "__main__":
TxindexCompatibilityTest().main()