fix token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248)
This commit is contained in:
parent
e7deecc7ce
commit
e6df378e9e
2 changed files with 2 additions and 2 deletions
|
@ -13,7 +13,7 @@ at anytime.
|
|||
*
|
||||
|
||||
### Fixed
|
||||
*
|
||||
* fixed token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248)
|
||||
*
|
||||
|
||||
### Deprecated
|
||||
|
|
|
@ -351,7 +351,7 @@ class Node(MockKademliaHelper):
|
|||
def verify_token(self, token, compact_ip):
|
||||
h = hashlib.new('sha384')
|
||||
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.update(self.old_token_secret + compact_ip)
|
||||
if not token == h.digest():
|
||||
|
|
Loading…
Reference in a new issue