aboutsummaryrefslogtreecommitdiff
path: root/test/functional/p2p_fingerprint.py
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2020-11-23 21:09:40 +0100
committerMarcoFalke <falke.marco@gmail.com>2020-11-23 20:58:50 +0100
commitfad7be584ffaf8099cc099d9378ba831c9483260 (patch)
tree251f2a8eddb9b0d6e1ecd3d56fa9112a23273a6d /test/functional/p2p_fingerprint.py
parent2ee954daaee5758d04935492139808cb6fd95233 (diff)
downloadbitcoin-fad7be584ffaf8099cc099d9378ba831c9483260.tar.xz
test: Fix intermittent p2p_finerprint issue
Diffstat (limited to 'test/functional/p2p_fingerprint.py')
-rwxr-xr-xtest/functional/p2p_fingerprint.py5
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()