fixed bytes issue with new pow and older python
This commit is contained in:
parent
3b04771eb7
commit
0f69bfd295
@ -159,6 +159,9 @@ class POW:
|
|||||||
self.metadata['powRandomToken'] = base64.b64encode(rand).decode()
|
self.metadata['powRandomToken'] = base64.b64encode(rand).decode()
|
||||||
payload = json.dumps(self.metadata).encode() + b'\n' + self.data
|
payload = json.dumps(self.metadata).encode() + b'\n' + self.data
|
||||||
token = myCore._crypto.sha3Hash(payload)
|
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)
|
#print(token)
|
||||||
if self.puzzle == token[0:self.difficulty]:
|
if self.puzzle == token[0:self.difficulty]:
|
||||||
self.hashing = False
|
self.hashing = False
|
||||||
|
Loading…
Reference in New Issue
Block a user