actually handle future-set blocks properly
This commit is contained in:
		
							parent
							
								
									a4370c26b0
								
							
						
					
					
						commit
						98bc3b3271
					
				
					 2 changed files with 4 additions and 7 deletions
				
			
		|  | @ -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…
	
	Add table
		Add a link
		
	
		Reference in a new issue