Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_fingerprint.py
Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# Force reorg to a longer chain | # Force reorg to a longer chain | ||||
node0.send_message(msg_headers(new_blocks)) | node0.send_message(msg_headers(new_blocks)) | ||||
node0.wait_for_getdata([x.sha256 for x in new_blocks]) | node0.wait_for_getdata([x.sha256 for x in new_blocks]) | ||||
for block in new_blocks: | for block in new_blocks: | ||||
node0.send_and_ping(msg_block(block)) | node0.send_and_ping(msg_block(block)) | ||||
# Check that reorg succeeded | # Check that reorg succeeded | ||||
self.nodes[0].unparkblock(new_blocks[-1].hash) | |||||
assert_equal(self.nodes[0].getblockcount(), 13) | assert_equal(self.nodes[0].getblockcount(), 13) | ||||
stale_hash = int(block_hashes[-1], 16) | stale_hash = int(block_hashes[-1], 16) | ||||
# Check that getdata request for stale block succeeds | # Check that getdata request for stale block succeeds | ||||
self.send_block_request(stale_hash, node0) | self.send_block_request(stale_hash, node0) | ||||
node0.wait_for_block(stale_hash, timeout=3) | node0.wait_for_block(stale_hash, timeout=3) | ||||
Show All 40 Lines |