forked from LBRYCommunity/lbry-sdk
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'
|
raise TypeError, 'No port available'
|
||||||
|
|
||||||
if 'lbryid' in value:
|
if 'lbryid' in value:
|
||||||
if len(value['lbryid']) > constants.key_bits:
|
if len(value['lbryid']) != constants.key_bits / 8:
|
||||||
raise ValueError, 'Invalid lbryid'
|
raise ValueError('Invalid lbryid (%i bytes): %s' % (len(value['lbryid']),
|
||||||
|
value['lbryid'].encode('hex')))
|
||||||
else:
|
else:
|
||||||
compact_address = compact_ip + compact_port + value['lbryid']
|
compact_address = compact_ip + compact_port + value['lbryid']
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue