diff options
author | Martin Zumsande <mzumsande@gmail.com> | 2022-05-23 21:07:29 +0200 |
---|---|---|
committer | Martin Zumsande <mzumsande@gmail.com> | 2023-05-17 11:14:28 -0400 |
commit | 97844d9268b87b5d09b1091bfd0326ed18ce5b91 (patch) | |
tree | a5f5056ea6825feb4b22e3533cd43025b29c4932 /test/functional/feature_coinstatsindex.py | |
parent | 60bec3c82d09ec208bf0028ad32499e251ad205e (diff) | |
download | bitcoin-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/feature_coinstatsindex.py')
-rwxr-xr-x | test/functional/feature_coinstatsindex.py | 15 |
1 files changed, 7 insertions, 8 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) |