Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_sendheaders.py
Show First 20 Lines • Show All 517 Lines • ▼ Show 20 Lines | def test_nonnull_locators(self, test_node, inv_node): | ||||
[x.sha256 for x in blocks], timeout=DIRECT_FETCH_RESPONSE_TIME) | [x.sha256 for x in blocks], timeout=DIRECT_FETCH_RESPONSE_TIME) | ||||
[test_node.send_message(msg_block(x)) for x in blocks] | [test_node.send_message(msg_block(x)) for x in blocks] | ||||
test_node.sync_with_ping() | test_node.sync_with_ping() | ||||
# Now announce a header that forks the last two blocks | # Now announce a header that forks the last two blocks | ||||
tip = blocks[0].sha256 | tip = blocks[0].sha256 | ||||
height -= 1 | height -= 2 | ||||
blocks = [] | blocks = [] | ||||
# Create extra blocks for later | # Create extra blocks for later | ||||
for b in range(20): | for b in range(20): | ||||
blocks.append(create_block( | blocks.append(create_block( | ||||
tip, create_coinbase(height), block_time)) | tip, create_coinbase(height), block_time)) | ||||
blocks[-1].solve() | blocks[-1].solve() | ||||
tip = blocks[-1].sha256 | tip = blocks[-1].sha256 | ||||
▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines |