Skip to content

Commit bb7788b

Browse files
committed
test: Test coinstatsindex robustness across restarts
1 parent e0938c2 commit bb7788b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/functional/feature_coinstatsindex.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,5 +224,18 @@ def _test_coin_stats_index(self):
224224
})
225225
self.block_sanity_check(res7['block_info'])
226226

227+
self.log.info("Test that the index is robust across restarts")
228+
229+
res8 = index_node.gettxoutsetinfo('muhash')
230+
self.restart_node(1, extra_args=self.extra_args[1])
231+
res9 = index_node.gettxoutsetinfo('muhash')
232+
assert_equal(res8, res9)
233+
234+
index_node.generate(1)
235+
self.wait_until(lambda: not try_rpc(-32603, "Unable to read UTXO set", index_node.gettxoutsetinfo, 'muhash'))
236+
res10 = index_node.gettxoutsetinfo('muhash')
237+
assert(res8['txouts'] < res10['txouts'])
238+
239+
227240
if __name__ == '__main__':
228241
CoinStatsIndexTest().main()

0 commit comments

Comments
 (0)