File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,15 @@ def no_sync():
159
159
self .connect_nodes (0 , 1 )
160
160
161
161
self .log .info (f"Ensuring snapshot chain syncs to tip. ({ FINAL_HEIGHT } )" )
162
- wait_until_helper (lambda : n1 .getchainstates ()['snapshot' ]['blocks' ] == FINAL_HEIGHT )
162
+
163
+ def check_for_final_height ():
164
+ chainstates = n1 .getchainstates ()
165
+ # The background validation may have completed before we run our first
166
+ # check, so accept a final blockheight from either chainstate type.
167
+ cs = chainstates .get ('snapshot' ) or chainstates .get ('normal' )
168
+ return cs ['blocks' ] == FINAL_HEIGHT
169
+
170
+ wait_until_helper (check_for_final_height )
163
171
self .sync_blocks (nodes = (n0 , n1 ))
164
172
165
173
self .log .info ("Ensuring background validation completes" )
You can’t perform that action at this time.
0 commit comments