From d23d4c1d7396ac486d52b2f3bd609af4296d56a3 Mon Sep 17 00:00:00 2001 From: Jack Robison Date: Wed, 11 Oct 2017 23:23:07 -0400 Subject: [PATCH] fix lbryid length comparison --- lbrynet/dht/node.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lbrynet/dht/node.py b/lbrynet/dht/node.py index bf1436f16..2dfa71fea 100644 --- a/lbrynet/dht/node.py +++ b/lbrynet/dht/node.py @@ -484,8 +484,9 @@ class Node(object): raise TypeError, 'No port available' if 'lbryid' in value: - if len(value['lbryid']) > constants.key_bits: - raise ValueError, 'Invalid lbryid' + if len(value['lbryid']) != constants.key_bits / 8: + raise ValueError('Invalid lbryid (%i bytes): %s' % (len(value['lbryid']), + value['lbryid'].encode('hex'))) else: compact_address = compact_ip + compact_port + value['lbryid'] else: