fix token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248)

This commit is contained in:
Jack Robison 2018-06-14 15:07:10 -04:00
parent e7deecc7ce
commit e6df378e9e
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
2 changed files with 2 additions and 2 deletions

View file

@ -13,7 +13,7 @@ at anytime.
* *
### Fixed ### Fixed
* * fixed token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248)
* *
### Deprecated ### Deprecated

View file

@ -351,7 +351,7 @@ class Node(MockKademliaHelper):
def verify_token(self, token, compact_ip): def verify_token(self, token, compact_ip):
h = hashlib.new('sha384') h = hashlib.new('sha384')
h.update(self.token_secret + compact_ip) h.update(self.token_secret + compact_ip)
if not token == h.digest(): if self.old_token_secret and not token == h.digest(): # TODO: why should we be accepting the previous token?
h = hashlib.new('sha384') h = hashlib.new('sha384')
h.update(self.old_token_secret + compact_ip) h.update(self.old_token_secret + compact_ip)
if not token == h.digest(): if not token == h.digest():