From e6df378e9e28dff63291f402aa9196dd0ecd5cbf Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Thu, 14 Jun 2018 15:07:10 -0400 Subject: [PATCH] fix token validation error when the dht node has just been started (https://github.com/lbryio/lbry/issues/1248) --- CHANGELOG.md | 2 +- lbrynet/dht/node.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 12ce54b85..beb02baad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index 0c38146a5..39e8291b0 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -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():