work on proof of work

This commit is contained in:
Kevin Froman 2018-05-05 17:36:03 -05:00
parent 7d9936e55c
commit 1f8eb925c6
3 changed files with 24 additions and 10 deletions

View file

@ -44,6 +44,7 @@ class POW:
blockCheckCount += 1
hbCount += 1
'''
rand = nacl.utils.random()
token = nacl.hash.blake2b(nacl.utils.random() + self.data).decode()
#print(token)
if self.puzzle == token[0:self.difficulty]:
@ -57,7 +58,7 @@ class POW:
if self.reporting:
logger.info('Found token ' + token, timestamp=True)
logger.info('took ' + str(endTime - startTime) + ' seconds', timestamp=True)
self.result = token
self.result = (token, rand)
def __init__(self, data, bitcoinNode=''):
self.foundHash = False