mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-05-17 23:56:39 +00:00
tests: assumeutxo: accept final height from either chainstate
This commit is contained in:
parent
5bd2010f02
commit
7e40032260
@ -159,7 +159,15 @@ class AssumeutxoTest(BitcoinTestFramework):
|
|||||||
self.connect_nodes(0, 1)
|
self.connect_nodes(0, 1)
|
||||||
|
|
||||||
self.log.info(f"Ensuring snapshot chain syncs to tip. ({FINAL_HEIGHT})")
|
self.log.info(f"Ensuring snapshot chain syncs to tip. ({FINAL_HEIGHT})")
|
||||||
wait_until_helper(lambda: n1.getchainstates()['snapshot']['blocks'] == FINAL_HEIGHT)
|
|
||||||
|
def check_for_final_height():
|
||||||
|
chainstates = n1.getchainstates()
|
||||||
|
# The background validation may have completed before we run our first
|
||||||
|
# check, so accept a final blockheight from either chainstate type.
|
||||||
|
cs = chainstates.get('snapshot') or chainstates.get('normal')
|
||||||
|
return cs['blocks'] == FINAL_HEIGHT
|
||||||
|
|
||||||
|
wait_until_helper(check_for_final_height)
|
||||||
self.sync_blocks(nodes=(n0, n1))
|
self.sync_blocks(nodes=(n0, n1))
|
||||||
|
|
||||||
self.log.info("Ensuring background validation completes")
|
self.log.info("Ensuring background validation completes")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user