Use init-time creation only of StorageCounter to use less inotify instances

This commit is contained in:
Kevin Froman 2020-08-21 09:56:49 -05:00
parent bbc9646a25
commit cd0b69b03f
4 changed files with 7 additions and 5 deletions

View file

@ -28,11 +28,13 @@ from .blocknoncestart import BLOCK_NONCE_START_INT
"""
config.reload()
storage_counter = storagecounter.StorageCounter()
def getDifficultyModifier():
"""returns the difficulty modifier for block storage based
on a variety of factors, currently only disk use.
"""
percentUse = storagecounter.StorageCounter().get_percent()
percentUse = storage_counter.get_percent()
difficultyIncrease = math.floor(4 * percentUse) # difficulty increase is a step function
return difficultyIncrease