Fixed index error when checking for pow
This commit is contained in:
parent
0f455b50c9
commit
973b8583b6
@ -102,9 +102,13 @@ class OnionrUtils:
|
|||||||
if newKeyList != False:
|
if newKeyList != False:
|
||||||
for key in newKeyList.split(','):
|
for key in newKeyList.split(','):
|
||||||
key = key.split('-')
|
key = key.split('-')
|
||||||
|
try:
|
||||||
if len(key[0]) > 60 or len(key[1]) > 1000:
|
if len(key[0]) > 60 or len(key[1]) > 1000:
|
||||||
logger.warn('%s or its pow value is too large.' % key[0])
|
logger.warn('%s or its pow value is too large.' % key[0])
|
||||||
continue
|
continue
|
||||||
|
except IndexError:
|
||||||
|
logger.warn('No pow token')
|
||||||
|
continue
|
||||||
if self._core._crypto.blake2bHash(base64.b64decode(key[1]) + key[0].encode()).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 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]):
|
if self._core.addPeer(key[0], key[1]):
|
||||||
|
Loading…
Reference in New Issue
Block a user