Browse Source

server_entry: save time when we sent challenge

master
a1batross 2 years ago
parent
commit
3cbb519ccb
  1. 5
      server_entry.py

5
server_entry.py

@ -60,11 +60,11 @@ class ServerEntry:
except IndexError: except IndexError:
pass pass
self.check = self.challenge == self.challenge2 self.check = self.challenge == self.challenge2
return self.check
def __init__(self, addr, challenge): def __init__(self, addr, challenge):
# Address # Address
self.addr = addr self.addr = addr
# Shortcuts for generating query # Shortcuts for generating query
self.queryAddr = b'' self.queryAddr = b''
for i in addr[0].split('.'): for i in addr[0].split('.'):
@ -73,6 +73,7 @@ class ServerEntry:
# Random number that server must return # Random number that server must return
self.challenge = challenge self.challenge = challenge
self.sentChallengeAt = time()
# This server is not checked # This server is not checked
# So it will not get into queries # So it will not get into queries
@ -80,4 +81,4 @@ class ServerEntry:
# Remove server after this time. # Remove server after this time.
# This maybe not instant # This maybe not instant
self.die = time() + 600.0 self.die = self.sentChallengeAt + 600

Loading…
Cancel
Save