actually handle future-set blocks properly
parent
a4370c26b0
commit
98bc3b3271
|
@ -33,9 +33,7 @@ class OnionrCrypto:
|
|||
self._keyFile = self._core.dataDir + 'keys.txt'
|
||||
self.pubKey = None
|
||||
self.privKey = None
|
||||
|
||||
self.secrets = secrets
|
||||
|
||||
self.deterministicRequirement = 25 # Min deterministic password/phrase length
|
||||
self.HASH_ID_ROUNDS = 2000
|
||||
self.keyManager = keymanager.KeyManager(self)
|
||||
|
@ -99,7 +97,6 @@ class OnionrCrypto:
|
|||
def pubKeyEncrypt(self, data, pubkey, anonymous=True, encodedData=False):
|
||||
'''Encrypt to a public key (Curve25519, taken from base32 Ed25519 pubkey)'''
|
||||
retVal = ''
|
||||
|
||||
try:
|
||||
pubkey = pubkey.encode()
|
||||
except AttributeError:
|
||||
|
|
|
@ -392,7 +392,7 @@ class OnionrUtils:
|
|||
if not self.isIntegerString(metadata[i]):
|
||||
logger.warn('Block metadata time stamp is not integer string')
|
||||
break
|
||||
if metadata[i] > self.getEpoch():
|
||||
if (metadata[i] - self.getEpoch()) > 30:
|
||||
logger.warn('Block metadata time stamp is set for the future, which is not allowed.')
|
||||
break
|
||||
if (self.getEpoch() - metadata[i]) > maxAge:
|
||||
|
|
Loading…
Reference in New Issue