* fixed broken block metadata validation, incorrect time integer check and missing size value for encryptType
This commit is contained in:
parent
9083775887
commit
33787ef39d
@ -329,6 +329,7 @@ class OnionrUtils:
|
|||||||
break
|
break
|
||||||
if i == 'time':
|
if i == 'time':
|
||||||
if not self.isIntegerString(metadata[i]):
|
if not self.isIntegerString(metadata[i]):
|
||||||
|
logger.warn('Block metadata time stamp is not integer string')
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
# if metadata loop gets no errors, it does not break, therefore metadata is valid
|
# if metadata loop gets no errors, it does not break, therefore metadata is valid
|
||||||
@ -358,9 +359,9 @@ class OnionrUtils:
|
|||||||
try:
|
try:
|
||||||
int(data)
|
int(data)
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return True
|
|
||||||
else:
|
|
||||||
return False
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
def validateID(self, id):
|
def validateID(self, id):
|
||||||
'''
|
'''
|
||||||
|
@ -21,4 +21,4 @@
|
|||||||
class OnionrValues:
|
class OnionrValues:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.passwordLength = 20
|
self.passwordLength = 20
|
||||||
self.blockMetadataLengths = {'meta': 1000, 'sig': 88, 'signer': 64, 'time': 10, 'powRandomToken': '1000'}
|
self.blockMetadataLengths = {'meta': 1000, 'sig': 88, 'signer': 64, 'time': 10, 'powRandomToken': 1000, 'encryptType': 4}
|
Loading…
Reference in New Issue
Block a user