Changeset View
Changeset View
Standalone View
Standalone View
test/functional/abc-finalize-block.py
Show All 32 Lines | def run_test(self): | ||||
self.log.info("Test block finalization...") | self.log.info("Test block finalization...") | ||||
node.generate(10) | node.generate(10) | ||||
tip = node.getbestblockhash() | tip = node.getbestblockhash() | ||||
node.finalizeblock(tip) | node.finalizeblock(tip) | ||||
assert_equal(node.getbestblockhash(), tip) | assert_equal(node.getbestblockhash(), tip) | ||||
alt_node = self.nodes[1] | alt_node = self.nodes[1] | ||||
connect_nodes_bi(self.nodes, 0, 1) | connect_nodes_bi(self.nodes[0], self.nodes[1]) | ||||
sync_blocks(self.nodes[0:2]) | sync_blocks(self.nodes[0:2]) | ||||
alt_node.invalidateblock(tip) | alt_node.invalidateblock(tip) | ||||
# We will use this later to check auto-finalization during a reorg | # We will use this later to check auto-finalization during a reorg | ||||
auto_finalized_tip = alt_node.getbestblockhash() | auto_finalized_tip = alt_node.getbestblockhash() | ||||
alt_node.generate(10) | alt_node.generate(10) | ||||
# Wait for node 0 to invalidate the chain. | # Wait for node 0 to invalidate the chain. | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |