From 8a36144675f99eef0e91b0b396de81e2dc1c5f9e Mon Sep 17 00:00:00 2001 From: 0Gitnick Date: Tue, 13 Aug 2019 14:51:46 -0500 Subject: [PATCH] Fix difficultyModifier --- onionr/onionrproofs.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/onionr/onionrproofs.py b/onionr/onionrproofs.py index 8402f727..8ccc376d 100755 --- a/onionr/onionrproofs.py +++ b/onionr/onionrproofs.py @@ -22,23 +22,15 @@ import config, logger, onionrblockapi, storagecounter from onionrutils import bytesconverter from onionrcrypto import hashers config.reload() + def getDifficultyModifier(): '''returns the difficulty modifier for block storage based on a variety of factors, currently only disk use. ''' - retData = 0 - useFunc = storagecounter.StorageCounter().getPercent + percentUse = storagecounter.StorageCounter().getPercent() + difficultyIncrease = math.floor(4 * percentUse) - percentUse = useFunc() - - if percentUse >= 0.50: - retData += 1 - elif percentUse >= 0.75: - retData += 2 - elif percentUse >= 0.95: - retData += 3 - - return retData + return difficultyIncrease def getDifficultyForNewBlock(data, ourBlock=True): '''