aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests
diff options
context:
space:
mode:
authorPieter Wuille <pieter.wuille@gmail.com>2016-04-21 14:14:37 +0200
committerPieter Wuille <pieter.wuille@gmail.com>2016-05-17 00:45:57 +0200
commitd3d75479115bc3480f163df774ee9dd2f8bd9f54 (patch)
tree5372055de2e359d991df93e0136aa74ee62761c5 /qa/rpc-tests
parentfb8fad1586ced69fa37c665a11916ae4c4d0df05 (diff)
Add -reindex-chainstate that does not rebuild block index
Diffstat (limited to 'qa/rpc-tests')
-rwxr-xr-xqa/rpc-tests/reindex.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/qa/rpc-tests/reindex.py b/qa/rpc-tests/reindex.py
index 39564b32ba..cb5e413fd6 100755
--- a/qa/rpc-tests/reindex.py
+++ b/qa/rpc-tests/reindex.py
@@ -4,7 +4,7 @@
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
-# Test -reindex with CheckBlockIndex
+# Test -reindex and -reindex-chainstate with CheckBlockIndex
#
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import *
@@ -20,13 +20,20 @@ class ReindexTest(BitcoinTestFramework):
self.is_network_split = False
self.nodes.append(start_node(0, self.options.tmpdir))
- def run_test(self):
+ def reindex(self, justchainstate=False):
self.nodes[0].generate(3)
+ blockcount = self.nodes[0].getblockcount()
stop_node(self.nodes[0], 0)
wait_bitcoinds()
- self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug", "-reindex", "-checkblockindex=1"])
- assert_equal(self.nodes[0].getblockcount(), 3)
+ self.nodes[0]=start_node(0, self.options.tmpdir, ["-debug", "-reindex-chainstate" if justchainstate else "-reindex", "-checkblockindex=1"])
+ assert_equal(self.nodes[0].getblockcount(), blockcount)
print("Success")
+ def run_test(self):
+ self.reindex(False)
+ self.reindex(True)
+ self.reindex(False)
+ self.reindex(True)
+
if __name__ == '__main__':
ReindexTest().main()