mirror of
https://github.com/de2tla2f/pymaster.git
synced 2024-11-30 14:51:28 +00:00
server_entry: save time when we sent challenge
This commit is contained in:
parent
4fa50a3bd0
commit
3cbb519ccb
|
@ -60,11 +60,11 @@ class ServerEntry:
|
|||
except IndexError:
|
||||
pass
|
||||
self.check = self.challenge == self.challenge2
|
||||
return self.check
|
||||
|
||||
def __init__(self, addr, challenge):
|
||||
# Address
|
||||
self.addr = addr
|
||||
|
||||
# Shortcuts for generating query
|
||||
self.queryAddr = b''
|
||||
for i in addr[0].split('.'):
|
||||
|
@ -73,6 +73,7 @@ class ServerEntry:
|
|||
|
||||
# Random number that server must return
|
||||
self.challenge = challenge
|
||||
self.sentChallengeAt = time()
|
||||
|
||||
# This server is not checked
|
||||
# So it will not get into queries
|
||||
|
@ -80,4 +81,4 @@ class ServerEntry:
|
|||
|
||||
# Remove server after this time.
|
||||
# This maybe not instant
|
||||
self.die = time() + 600.0
|
||||
self.die = self.sentChallengeAt + 600
|
||||
|
|
Loading…
Reference in a new issue