Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-finalize-block.py
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# >(210 valid-headers)->(211 invalid)->(212 to 218 dropped) | # >(210 valid-headers)->(211 invalid)->(212 to 218 dropped) | ||||
# / | # / | ||||
# (200)->(201)-> // ->(209)->(210 finalized, tip) | # (200)->(201)-> // ->(209)->(210 finalized, tip) | ||||
def wait_for_block(node, block, status="invalid"): | def wait_for_block(node, block, status="invalid"): | ||||
def check_block(): | def check_block(): | ||||
for tip in node.getchaintips(): | for tip in node.getchaintips(): | ||||
if tip["hash"] == block: | if tip["hash"] == block: | ||||
assert(tip["status"] != "active") | assert tip["status"] != "active" | ||||
return tip["status"] == status | return tip["status"] == status | ||||
return False | return False | ||||
wait_until(check_block) | wait_until(check_block) | ||||
# First block header is accepted as valid-header | # First block header is accepted as valid-header | ||||
alt_node.generate(1) | alt_node.generate(1) | ||||
wait_for_block(node, alt_node.getbestblockhash(), "valid-headers") | wait_for_block(node, alt_node.getbestblockhash(), "valid-headers") | ||||
▲ Show 20 Lines • Show All 233 Lines • Show Last 20 Lines |