aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_coinstatsindex.py
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-02-25 19:14:58 +0100
committerFabian Jahr <fjahr@protonmail.com>2021-04-19 20:31:02 +0200
commitbb7788b121a30489bc81a1f46dde6a9b19ae4ec1 (patch)
treea2d3dfc4f8f5a654a4dbe58cc2dfc735fd0c63b0 /test/functional/feature_coinstatsindex.py
parente0938c29099635150014ffc9bb0cafa8049ec55a (diff)
downloadbitcoin-bb7788b121a30489bc81a1f46dde6a9b19ae4ec1.tar.xz
test: Test coinstatsindex robustness across restarts
Diffstat (limited to 'test/functional/feature_coinstatsindex.py')
-rwxr-xr-xtest/functional/feature_coinstatsindex.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py
index 4aa89f47f6..d517c149cd 100755
--- a/test/functional/feature_coinstatsindex.py
+++ b/test/functional/feature_coinstatsindex.py
@@ -224,5 +224,18 @@ class CoinStatsIndexTest(BitcoinTestFramework):
})
self.block_sanity_check(res7['block_info'])
+ self.log.info("Test that the index is robust across restarts")
+
+ res8 = index_node.gettxoutsetinfo('muhash')
+ self.restart_node(1, extra_args=self.extra_args[1])
+ res9 = index_node.gettxoutsetinfo('muhash')
+ assert_equal(res8, res9)
+
+ index_node.generate(1)
+ self.wait_until(lambda: not try_rpc(-32603, "Unable to read UTXO set", index_node.gettxoutsetinfo, 'muhash'))
+ res10 = index_node.gettxoutsetinfo('muhash')
+ assert(res8['txouts'] < res10['txouts'])
+
+
if __name__ == '__main__':
CoinStatsIndexTest().main()