From b46bd42d9e6aa21711b9c17267adf927c0552e1a Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Fri, 24 Aug 2018 17:42:09 -0500 Subject: [PATCH] fixed invalid argument call --- onionr/communicator2.py | 4 +++- onionr/core.py | 2 ++ onionr/storagecounter.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/onionr/communicator2.py b/onionr/communicator2.py index 42bbbce8..df428c03 100755 --- a/onionr/communicator2.py +++ b/onionr/communicator2.py @@ -199,6 +199,8 @@ class OnionrCommunicatorDaemon: logger.debug('%s is already saved' % (blockHash,)) self.blockQueue.remove(blockHash) continue + if self._core._blacklist.inBlacklist(blockHash): + continue if self._core._utils.storageCounter.isFull(): break self.currentDownloading.append(blockHash) # So we can avoid concurrent downloading in other threads of same block @@ -223,7 +225,7 @@ class OnionrCommunicatorDaemon: #meta = metas[1] if self._core._utils.validateMetadata(metadata, metas[2]): # check if metadata is valid, and verify nonce if self._core._crypto.verifyPow(content): # check if POW is enough/correct - logger.info('Block passed proof, attemping save.') + logger.info('Block passed proof, attempting save.') try: self._core.setData(content) except onionrexceptions.DiskAllocationReached: diff --git a/onionr/core.py b/onionr/core.py index c6495f2f..9d0b831d 100644 --- a/onionr/core.py +++ b/onionr/core.py @@ -52,6 +52,8 @@ class Core: self.usageFile = 'data/disk-usage.txt' self.config = config + self.maxBlockSize = 10000000 # max block size in bytes + if not os.path.exists('data/'): os.mkdir('data/') if not os.path.exists('data/blocks/'): diff --git a/onionr/storagecounter.py b/onionr/storagecounter.py index b88bc4f5..4468dacc 100644 --- a/onionr/storagecounter.py +++ b/onionr/storagecounter.py @@ -27,7 +27,7 @@ class StorageCounter: def isFull(self): retData = False - if self._core.config.get('allocations.disk') <= (self.getAmount() + 500): + if self._core.config.get('allocations.disk') <= (self.getAmount() + 1000): retData = True return retData