fixed invalid argument call

This commit is contained in:
Kevin Froman 2018-08-24 17:42:09 -05:00
parent e346c09228
commit b46bd42d9e
3 changed files with 6 additions and 2 deletions

View File

@ -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:

View File

@ -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/'):

View File

@ -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