From 2c70531a518e0ad7eba3d5cd159ff2dc3cbc9aec Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 10 Jul 2018 02:11:58 -0500 Subject: [PATCH] fixed invalid bytes concat when hash is invalid on some versions --- onionr/communicator2.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/onionr/communicator2.py b/onionr/communicator2.py index 99244985..c59a8df7 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -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