aboutsummaryrefslogtreecommitdiff
path: root/test/functional/feature_assumeutxo.py
diff options
context:
space:
mode:
authorJames O'Beirne <james.obeirne@pm.me>2023-10-04 11:18:14 -0400
committerJames O'Beirne <james.obeirne@pm.me>2023-10-04 11:32:36 -0400
commit7e4003226030a04a19c718a4b1b83b4ca40ca33f (patch)
treefbe64af02707e211e0a58c4e44902681718e88df /test/functional/feature_assumeutxo.py
parent5bd2010f024b5bcccf1d57bae6fc36c53f5facc5 (diff)
downloadbitcoin-7e4003226030a04a19c718a4b1b83b4ca40ca33f.tar.xz
tests: assumeutxo: accept final height from either chainstate
Diffstat (limited to 'test/functional/feature_assumeutxo.py')
-rwxr-xr-xtest/functional/feature_assumeutxo.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/test/functional/feature_assumeutxo.py b/test/functional/feature_assumeutxo.py
index 4d0552f332..be0715df32 100755
--- a/test/functional/feature_assumeutxo.py
+++ b/test/functional/feature_assumeutxo.py
@@ -159,7 +159,15 @@ class AssumeutxoTest(BitcoinTestFramework):
self.connect_nodes(0, 1)
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.log.info("Ensuring background validation completes")