aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
authorMartin Zumsande <mzumsande@gmail.com>2022-05-23 21:07:29 +0200
committerMartin Zumsande <mzumsande@gmail.com>2023-05-17 11:14:28 -0400
commit97844d9268b87b5d09b1091bfd0326ed18ce5b91 (patch)
treea5f5056ea6825feb4b22e3533cd43025b29c4932 /test/functional
parent60bec3c82d09ec208bf0028ad32499e251ad205e (diff)
downloadbitcoin-97844d9268b87b5d09b1091bfd0326ed18ce5b91.tar.xz
index: Enable reindex-chainstate with active indexes
This is achieved by letting the index sync thread wait until reindex-chainstate is finished. This also disables the pruning check when reindexing the chainstate (which is incompatible with prune mode) because there would be no chain at this point in init.
Diffstat (limited to 'test/functional')
-rwxr-xr-xtest/functional/feature_coinstatsindex.py15
-rwxr-xr-xtest/functional/p2p_blockfilters.py7
2 files changed, 7 insertions, 15 deletions
diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py
index 73f4d83e43..eacdeb43eb 100755
--- a/test/functional/feature_coinstatsindex.py
+++ b/test/functional/feature_coinstatsindex.py
@@ -231,18 +231,16 @@ class CoinStatsIndexTest(BitcoinTestFramework):
self.log.info("Test that the index works with -reindex")
self.restart_node(1, extra_args=["-coinstatsindex", "-reindex"])
+ self.sync_index_node()
res11 = index_node.gettxoutsetinfo('muhash')
assert_equal(res11, res10)
- self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
+ self.log.info("Test that the index works with -reindex-chainstate")
- self.stop_node(1)
- self.nodes[1].assert_start_raises_init_error(
- expected_msg='Error: -reindex-chainstate option is not compatible with -coinstatsindex. '
- 'Please temporarily disable coinstatsindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
- extra_args=['-coinstatsindex', '-reindex-chainstate'],
- )
- self.restart_node(1, extra_args=["-coinstatsindex"])
+ self.restart_node(1, extra_args=["-coinstatsindex", "-reindex-chainstate"])
+ self.sync_index_node()
+ res12 = index_node.gettxoutsetinfo('muhash')
+ assert_equal(res12, res10)
def _test_use_index_option(self):
self.log.info("Test use_index option for nodes running the index")
@@ -261,6 +259,7 @@ class CoinStatsIndexTest(BitcoinTestFramework):
index_node = self.nodes[1]
reorg_blocks = self.generatetoaddress(index_node, 2, getnewdestination()[2])
reorg_block = reorg_blocks[1]
+ self.sync_index_node()
res_invalid = index_node.gettxoutsetinfo('muhash')
index_node.invalidateblock(reorg_blocks[0])
assert_equal(index_node.gettxoutsetinfo('muhash')['height'], 110)
diff --git a/test/functional/p2p_blockfilters.py b/test/functional/p2p_blockfilters.py
index 2da9037a69..e4908735c9 100755
--- a/test/functional/p2p_blockfilters.py
+++ b/test/functional/p2p_blockfilters.py
@@ -255,13 +255,6 @@ class CompactFiltersTest(BitcoinTestFramework):
msg = "Error: Unknown -blockfilterindex value abc."
self.nodes[0].assert_start_raises_init_error(expected_msg=msg)
- self.log.info("Test -blockfilterindex with -reindex-chainstate raises an error")
- self.nodes[0].assert_start_raises_init_error(
- expected_msg='Error: -reindex-chainstate option is not compatible with -blockfilterindex. '
- 'Please temporarily disable blockfilterindex while using -reindex-chainstate, or replace -reindex-chainstate with -reindex to fully rebuild all indexes.',
- extra_args=['-blockfilterindex', '-reindex-chainstate'],
- )
-
def compute_last_header(prev_header, hashes):
"""Compute the last filter header from a starting header and a sequence of filter hashes."""
header = ser_uint256(prev_header)