fixed bytes on new pow in older python versions
parent
0f69bfd295
commit
85fdcab534
|
@ -1,3 +1,5 @@
|
|||
#!/bin/sh
|
||||
cd onionr/
|
||||
cp -R static-data/default-plugins/pms/ data/plugins/
|
||||
cp -R static-data/default-plugins/flow/ data/plugins/
|
||||
./onionr.py "$@"
|
||||
|
|
|
@ -159,10 +159,11 @@ 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)
|
||||
try:
|
||||
# on some versions, token is bytes
|
||||
token = token.decode()
|
||||
except AttributeError:
|
||||
pass
|
||||
if self.puzzle == token[0:self.difficulty]:
|
||||
self.hashing = False
|
||||
iFound = True
|
||||
|
|
Loading…
Reference in New Issue