fix lbryid length comparison
This commit is contained in:
parent
4b0082d5bc
commit
d23d4c1d73
1 changed files with 3 additions and 2 deletions
|
@ -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:
|
||||
|
|
Loading…
Reference in a new issue