Changeset View
Changeset View
Standalone View
Standalone View
test/functional/p2p_fingerprint.py
Show First 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | def last_header_equals(self, expected_hash, node): | ||||
headers_msg.headers[0].rehash() == expected_hash) | headers_msg.headers[0].rehash() == expected_hash) | ||||
# Checks that stale blocks timestamped more than a month ago are not served | # Checks that stale blocks timestamped more than a month ago are not served | ||||
# by the node while recent stale blocks and old active chain blocks are. | # by the node while recent stale blocks and old active chain blocks are. | ||||
# This does not currently test that stale blocks timestamped within the | # This does not currently test that stale blocks timestamped within the | ||||
# last month but that have over a month's worth of work are also withheld. | # last month but that have over a month's worth of work are also withheld. | ||||
def run_test(self): | def run_test(self): | ||||
node0 = self.nodes[0].add_p2p_connection(P2PInterface()) | node0 = self.nodes[0].add_p2p_connection(P2PInterface()) | ||||
node0.wait_for_verack() | |||||
# Set node time to 60 days ago | # Set node time to 60 days ago | ||||
self.nodes[0].setmocktime(int(time.time()) - 60 * 24 * 60 * 60) | self.nodes[0].setmocktime(int(time.time()) - 60 * 24 * 60 * 60) | ||||
# Generating a chain of 10 blocks | # Generating a chain of 10 blocks | ||||
block_hashes = self.nodes[0].generate(nblocks=10) | block_hashes = self.nodes[0].generate(nblocks=10) | ||||
# Create longer chain starting 2 blocks before current tip | # Create longer chain starting 2 blocks before current tip | ||||
▲ Show 20 Lines • Show All 68 Lines • Show Last 20 Lines |