Shorten hashMeetsDifficulty function

This commit is contained in:
0Gitnick 2019-08-13 15:18:43 -05:00
parent 401723f5ab
commit 6c091acd34
1 changed files with 5 additions and 6 deletions

View File

@ -63,19 +63,18 @@ def getHashDifficulty(hexHash):
return difficulty
def hashMeetsDifficulty(h):
def hashMeetsDifficulty(hexHash):
'''
Return bool for a hash string to see if it meets pow difficulty defined in config
'''
hashDifficulty = getHashDifficulty(h)
hashDifficulty = getHashDifficulty(hexHash)
try:
expected = int(config.get('general.minimum_block_pow'))
except TypeError:
raise ValueError('Missing general.minimum_block_pow config')
if hashDifficulty >= expected:
return True
else:
return False
return hashDifficulty >= expected
class DataPOW:
def __init__(self, data, forceDifficulty=0, threadCount = 1):