diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index 4e7b05bb..02d26592 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -105,7 +105,7 @@ class OnionrUtils: if len(key[0]) > 60 or len(key[1]) > 1000: logger.warn(key[0] + ' or its pow value is too large.') continue - if self._core._crypto.blake2bHash(base64.b64decode(key[1]) + key[0]).startswith('0000'): + if self._core._crypto.blake2bHash(base64.b64decode(key[1]) + key[0].encode()).startswith('0000'): if not key[0] in self._core.listPeers(randomOrder=False) and type(key) != None and key[0] != self._core._crypto.pubKey: if self._core.addPeer(key[0], key[1]): retVal = True diff --git a/onionr/tests.py b/onionr/tests.py index 7eea62d3..d78b128d 100755 --- a/onionr/tests.py +++ b/onionr/tests.py @@ -56,7 +56,7 @@ class OnionrTests(unittest.TestCase): myCore = core.Core() if not os.path.exists('data/peers.db'): myCore.createPeerDB() - if myCore.addPeer('6M5MXL237OK57ITHVYN5WGHANPGOMKS5C3PJLHBBNKFFJQOIDOJA====') and not myCore.addPeer('NFXHMYLMNFSAU==='): + if myCore.addPeer('6M5MXL237OK57ITHVYN5WGHANPGOMKS5C3PJLHBBNKFFJQOIDOJA====', '1cSix9Ao/yQSdo0sNif8cm2uTcYnSphb4JdZL/3WkN4=') and not myCore.addPeer('NFXHMYLMNFSAU===', '1cSix9Ao/yQSdo0sNif8cm2uTcYnSphb4JdZL/3WkN4='): self.assertTrue(True) else: self.assertTrue(False)