mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-28 14:53:03 +02:00
test: Fix intermittent p2p_finerprint issue
This commit is contained in:
@@ -98,9 +98,9 @@ class P2PFingerprintTest(BitcoinTestFramework):
|
|||||||
|
|
||||||
# Longest chain is extended so stale is much older than chain tip
|
# Longest chain is extended so stale is much older than chain tip
|
||||||
self.nodes[0].setmocktime(0)
|
self.nodes[0].setmocktime(0)
|
||||||
self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address)
|
block_hash = int(self.nodes[0].generatetoaddress(1, self.nodes[0].get_deterministic_priv_key().address)[-1], 16)
|
||||||
assert_equal(self.nodes[0].getblockcount(), 14)
|
assert_equal(self.nodes[0].getblockcount(), 14)
|
||||||
node0.sync_with_ping()
|
node0.wait_for_block(block_hash, timeout=3)
|
||||||
|
|
||||||
# Request for very old stale block should now fail
|
# Request for very old stale block should now fail
|
||||||
with p2p_lock:
|
with p2p_lock:
|
||||||
@@ -128,5 +128,6 @@ class P2PFingerprintTest(BitcoinTestFramework):
|
|||||||
self.send_header_request(block_hash, node0)
|
self.send_header_request(block_hash, node0)
|
||||||
node0.wait_for_header(hex(block_hash), timeout=3)
|
node0.wait_for_header(hex(block_hash), timeout=3)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
P2PFingerprintTest().main()
|
P2PFingerprintTest().main()
|
||||||
|
Reference in New Issue
Block a user