diff options
author | MarcoFalke <falke.marco@gmail.com> | 2020-12-03 10:09:23 +0100 |
---|---|---|
committer | MarcoFalke <falke.marco@gmail.com> | 2020-12-03 10:09:30 +0100 |
commit | 681ce59d0eac005203af1ff5bd64a1e6f2fa53e7 (patch) | |
tree | a7edce055871b9ade554c26e30f2bfe3177b38ac /test | |
parent | a35b948836db20fab9b48d3b77cf9f23ffee109a (diff) | |
parent | fad7be584ffaf8099cc099d9378ba831c9483260 (diff) | |
download | bitcoin-681ce59d0eac005203af1ff5bd64a1e6f2fa53e7.tar.xz |
Merge #20466: test: Fix intermittent p2p_fingerprint issue
fad7be584ffaf8099cc099d9378ba831c9483260 test: Fix intermittent p2p_finerprint issue (MarcoFalke)
Pull request description:
A single sync_with_ping can't be used to drop a block announcement, as the block might be sent *after* the ping has been responded to.
Fix that by waiting for the block.
ACKs for top commit:
theStack:
ACK fad7be584ffaf8099cc099d9378ba831c9483260
Tree-SHA512: d43ba9d07273486858f65a26326cc6637ef743bf7b400e5048ba7eac266fb1893283e6503dd49f179caa1abab2977315fb70ba9fba34be9a817a74259d8e4034
Diffstat (limited to 'test')
-rwxr-xr-x | test/functional/p2p_fingerprint.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/test/functional/p2p_fingerprint.py b/test/functional/p2p_fingerprint.py index f60eba2dbf..9614ab6872 100755 --- a/test/functional/p2p_fingerprint.py +++ b/test/functional/p2p_fingerprint.py @@ -98,9 +98,9 @@ class P2PFingerprintTest(BitcoinTestFramework): # Longest chain is extended so stale is much older than chain tip 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) - node0.sync_with_ping() + node0.wait_for_block(block_hash, timeout=3) # Request for very old stale block should now fail with p2p_lock: @@ -128,5 +128,6 @@ class P2PFingerprintTest(BitcoinTestFramework): self.send_header_request(block_hash, node0) node0.wait_for_header(hex(block_hash), timeout=3) + if __name__ == '__main__': P2PFingerprintTest().main() |