fixed bytes issue with new pow and older python
parent
3b04771eb7
commit
0f69bfd295
|
@ -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…
Reference in New Issue