Skip to content

Commit fa3fafc

Browse files
author
MarcoFalke
committed
[qa] wallet: Wait for reindex to catch up
1 parent 84370d5 commit fa3fafc

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

qa/rpc-tests/wallet.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,7 @@ def run_test (self):
279279
blocks = self.nodes[0].generate(2)
280280
self.sync_all()
281281
balance_nodes = [self.nodes[i].getbalance() for i in range(3)]
282+
block_count = self.nodes[0].getblockcount()
282283

283284
maintenance = [
284285
'-rescan',
@@ -292,6 +293,9 @@ def run_test (self):
292293
stop_nodes(self.nodes)
293294
wait_bitcoinds()
294295
self.nodes = start_nodes(3, self.options.tmpdir, [[m]] * 3)
296+
while m == '-reindex' and [block_count] * 3 != [self.nodes[i].getblockcount() for i in range(3)]:
297+
# reindex will leave rpc warm up "early"; Wait for it to finish
298+
time.sleep(0.1)
295299
assert_equal(balance_nodes, [self.nodes[i].getbalance() for i in range(3)])
296300

297301
# Exercise listsinceblock with the last two blocks

0 commit comments

Comments
 (0)