Skip to content

Commit fab7ee3

Browse files
author
MarcoFalke
committed
test: Fix p2p_leak intermittent issue
1 parent fa8614a commit fab7ee3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

test/functional/p2p_leak.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,12 +141,11 @@ def run_test(self):
141141
assert no_verack_idlenode.unexpected_msg == False
142142

143143
self.log.info('Check that the version message does not leak the local address of the node')
144-
time_begin = int(time.time())
145144
p2p_version_store = self.nodes[0].add_p2p_connection(P2PVersionStore())
146-
time_end = time.time()
147145
ver = p2p_version_store.version_received
148-
assert_greater_than_or_equal(ver.nTime, time_begin)
149-
assert_greater_than_or_equal(time_end, ver.nTime)
146+
# Check that received time is within one hour of now
147+
assert_greater_than_or_equal(ver.nTime, time.time() - 3600)
148+
assert_greater_than_or_equal(time.time() + 3600, ver.nTime)
150149
assert_equal(ver.addrFrom.port, 0)
151150
assert_equal(ver.addrFrom.ip, '0.0.0.0')
152151
assert_equal(ver.nStartingHeight, 201)

0 commit comments

Comments
 (0)