From 973b8583b6ecbb5ebb219c71dfeae1afba0f3ccf Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Mon, 14 May 2018 20:10:05 -0500 Subject: [PATCH] Fixed index error when checking for pow --- onionr/onionrutils.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/onionr/onionrutils.py b/onionr/onionrutils.py index fe2438a1..1a1afcc3 100644 --- a/onionr/onionrutils.py +++ b/onionr/onionrutils.py @@ -102,8 +102,12 @@ class OnionrUtils: if newKeyList != False: for key in newKeyList.split(','): key = key.split('-') - if len(key[0]) > 60 or len(key[1]) > 1000: - logger.warn('%s or its pow value is too large.' % key[0]) + try: + if len(key[0]) > 60 or len(key[1]) > 1000: + logger.warn('%s or its pow value is too large.' % key[0]) + continue + except IndexError: + logger.warn('No pow token') continue 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: