129@@ -130,8 +130,8 @@ def no_sync():
130
131 monitor = n1.getchainstates()
132 assert_equal(monitor['normal']['blocks'], START_HEIGHT)
133- assert_equal(monitor['snapshot']['blocks'], SNAPSHOT_BASE_HEIGHT)
134- assert_equal(monitor['snapshot']['snapshot_blockhash'], dump_output['base_hash'])
135+ assert_equal(monitor.get('snapshot', {}).get('blocks'), SNAPSHOT_BASE_HEIGHT)
136+ assert_equal(monitor.get('snapshot', {}).get('snapshot_blockhash'), dump_output['base_hash'])
not sure. What is the goal of those changes, other than making the code more verbose and harder to read?
snapshot
is an optional key in the RPC’s return value, so if the above call returns before a snapshot chainstate is loaded, it will
KeyError
as I’ve shown in
#28585.
Oh I see what you’re saying - the test will still fail; of course… Reverting those.
But then the assert_equal will fail anyway later on, no?