Use init-time creation only of StorageCounter to use less inotify instances
This commit is contained in:
parent
bbc9646a25
commit
cd0b69b03f
4 changed files with 7 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue