Some microimprovements
This commit is contained in:
parent
26b1cc5d87
commit
00ad409737
@ -50,12 +50,8 @@ def getHashDifficulty(hexHash):
|
||||
'''
|
||||
Return the amount of leading zeroes in a hex hash string (hexHash)
|
||||
'''
|
||||
difficulty = 0
|
||||
assert type(hexHash) is str
|
||||
|
||||
difficulty = len(hexHash) - len(hexHash.lstrip('0'))
|
||||
|
||||
return difficulty
|
||||
return len(hexHash) - len(hexHash.lstrip('0'))
|
||||
|
||||
def hashMeetsDifficulty(hexHash):
|
||||
'''
|
||||
|
@ -21,7 +21,7 @@
|
||||
def detect_optimization():
|
||||
'''Returns true if Python is run in optimized mode (-o), based on optimization ignoring assert statements'''
|
||||
try:
|
||||
assert True is False
|
||||
assert False
|
||||
except AssertionError:
|
||||
return False
|
||||
return True
|
@ -1,6 +1,4 @@
|
||||
import netcontroller
|
||||
|
||||
def has_tor():
|
||||
if netcontroller.tor_binary() is None:
|
||||
return False
|
||||
return True
|
||||
return netcontroller.tor_binary() is not None
|
Loading…
Reference in New Issue
Block a user