c# pow implementation work

This commit is contained in:
Kevin Froman 2020-09-23 00:36:08 +00:00
parent e9dbc9fa09
commit 60d6aa0510
3 changed files with 45 additions and 7 deletions

View file

@ -116,6 +116,7 @@ class SubprocessPOW:
metadata['n'] = secrets.randbits(16)
puzzle = self.puzzle
difficulty = self.difficulty
start = time.time()
while True:
# Break if shutdown received
@ -135,5 +136,6 @@ class SubprocessPOW:
token = bytesconverter.bytes_to_str(token)
if puzzle == token[0:difficulty]:
pipe.send(payload)
print(metadata['pow'], time.time() - start)
break
nonce += 1