mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-30 06:51:08 +02:00
test: Use rehash() in outbound eviction block-relay
Ensure that tip_header.rehash() is used instead of tip_header.hash, which is None when the header is deserialized from hex. This avoids depending on wait_for_getheaders() falling back to any received message, making the test more explicit and robust.
This commit is contained in:
@@ -235,7 +235,7 @@ class P2POutEvict(BitcoinTestFramework):
|
|||||||
cur_mock_time += (CHAIN_SYNC_TIMEOUT + 1)
|
cur_mock_time += (CHAIN_SYNC_TIMEOUT + 1)
|
||||||
node.setmocktime(cur_mock_time)
|
node.setmocktime(cur_mock_time)
|
||||||
peer.sync_with_ping()
|
peer.sync_with_ping()
|
||||||
peer.wait_for_getheaders(block_hash=tip_header.hash)
|
peer.wait_for_getheaders(block_hash=tip_header.rehash())
|
||||||
cur_mock_time += (HEADERS_RESPONSE_TIME + 1)
|
cur_mock_time += (HEADERS_RESPONSE_TIME + 1)
|
||||||
node.setmocktime(cur_mock_time)
|
node.setmocktime(cur_mock_time)
|
||||||
self.log.info("Test that the peer gets evicted")
|
self.log.info("Test that the peer gets evicted")
|
||||||
|
Reference in New Issue
Block a user