fixed bytes issue with new pow and older python
This commit is contained in:
		
							parent
							
								
									3b04771eb7
								
							
						
					
					
						commit
						0f69bfd295
					
				
					 1 changed files with 3 additions and 0 deletions
				
			
		|  | @ -159,6 +159,9 @@ class POW: | |||
|             self.metadata['powRandomToken'] = base64.b64encode(rand).decode() | ||||
|             payload = json.dumps(self.metadata).encode() + b'\n' + self.data | ||||
|             token = myCore._crypto.sha3Hash(payload) | ||||
|             if type(token) is bytes: | ||||
|                 # crypto.sha3Hash returns bytes on some older python versions | ||||
|                 self.puzzle = self.puzzle.encode() | ||||
|             #print(token) | ||||
|             if self.puzzle == token[0:self.difficulty]: | ||||
|                 self.hashing = False | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue