mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-25 22:39:13 +02:00
index: Drop legacy -txindex check
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user