fixed invalid bytes concat when hash is invalid on some versions

This commit is contained in:
Kevin Froman 2018-07-10 02:11:58 -05:00
parent 33787ef39d
commit 2c70531a51
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
1 changed files with 6 additions and 1 deletions

View File

@ -177,7 +177,12 @@ class OnionrCommunicatorDaemon:
logger.warn('Metadata for ' + blockHash + ' is invalid.')
else:
# if block didn't meet expected hash
logger.warn('Block hash validation failed for ' + blockHash + ' got ' + self._core._crypto.sha3Hash(content))
tempHash = self._core._crypto.sha3Hash(content) # lazy hack, TODO use var
try:
tempHash = tempHash.decode()
except AttributeError:
pass
logger.warn('Block hash validation failed for ' + blockHash + ' got ' + tempHash)
self.blockQueue.remove(blockHash) # remove from block queue both if success or false
self.decrementThreadCount('getBlocks')
return