moved length check in hash validation

This commit is contained in:
Kevin Froman 2018-01-28 20:54:39 -06:00
parent 1c3e886ba0
commit 8c6a04f03d
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B

View File

@ -108,12 +108,13 @@ class OnionrCommunicate:
logger.debug('BLOCKS: \n' + blocks) logger.debug('BLOCKS: \n' + blocks)
blockList = blocks.split('\n') blockList = blocks.split('\n')
for i in blockList: for i in blockList:
if len(i.strip()) == 0:
continue
if self._utils.hasBlock(i): if self._utils.hasBlock(i):
continue continue
logger.debug('Exchanged block (blockList): ' + i) logger.debug('Exchanged block (blockList): ' + i)
if not self._utils.validateHash(i): if not self._utils.validateHash(i):
# skip hash if it isn't valid # skip hash if it isn't valid
if len(i.strip()) != 0:
logger.warn('Hash ' + i + ' is not valid') logger.warn('Hash ' + i + ' is not valid')
continue continue
else: else: