Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_sendheaders.py
Show First 20 Lines • Show All 419 Lines • ▼ Show 20 Lines | def test_nonnull_locators(self, test_node, inv_node): | ||||
# inv | # inv | ||||
new_block_hashes = self.mine_reorg(length=8) | new_block_hashes = self.mine_reorg(length=8) | ||||
tip = new_block_hashes[-1] | tip = new_block_hashes[-1] | ||||
inv_node.check_last_inv_announcement(inv=[tip]) | inv_node.check_last_inv_announcement(inv=[tip]) | ||||
test_node.check_last_inv_announcement(inv=[tip]) | test_node.check_last_inv_announcement(inv=[tip]) | ||||
block_time += 9 | block_time += 9 | ||||
fork_point = self.nodes[0].getblock("{:02x}".format( | fork_point = self.nodes[0].getblock("{:064x}".format( | ||||
new_block_hashes[0]))["previousblockhash"] | new_block_hashes[0]))["previousblockhash"] | ||||
fork_point = int(fork_point, 16) | fork_point = int(fork_point, 16) | ||||
# Use getblocks/getdata | # Use getblocks/getdata | ||||
test_node.send_getblocks(locator=[fork_point]) | test_node.send_getblocks(locator=[fork_point]) | ||||
test_node.check_last_inv_announcement(inv=new_block_hashes) | test_node.check_last_inv_announcement(inv=new_block_hashes) | ||||
test_node.send_get_data(new_block_hashes) | test_node.send_get_data(new_block_hashes) | ||||
test_node.wait_for_block(new_block_hashes[-1]) | test_node.wait_for_block(new_block_hashes[-1]) | ||||
▲ Show 20 Lines • Show All 210 Lines • Show Last 20 Lines |