mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-18 22:35:39 +01:00
init: disallow reindex-chainstate with optional indexes
It currently leads to corruption (coinstatsindex) or data duplication (blockfilterindex), so disable it.
This commit is contained in:
@@ -223,6 +223,20 @@ class CoinStatsIndexTest(BitcoinTestFramework):
|
||||
res10 = index_node.gettxoutsetinfo('muhash')
|
||||
assert(res8['txouts'] < res10['txouts'])
|
||||
|
||||
self.log.info("Test that the index works with -reindex")
|
||||
|
||||
self.restart_node(1, extra_args=["-coinstatsindex", "-reindex"])
|
||||
res11 = index_node.gettxoutsetinfo('muhash')
|
||||
assert_equal(res11, res10)
|
||||
|
||||
self.log.info("Test that -reindex-chainstate is disallowed with coinstatsindex")
|
||||
|
||||
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'],
|
||||
)
|
||||
|
||||
def _test_use_index_option(self):
|
||||
self.log.info("Test use_index option for nodes running the index")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user