server_entry: save time when we sent challenge

This commit is contained in:
a1batross 2022-12-07 20:03:24 +01:00
parent 4fa50a3bd0
commit 3cbb519ccb
1 changed files with 8 additions and 7 deletions

View File

@ -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