do not try to download already saved blocks from upload

master
Kevin Froman 2018-08-16 23:21:21 -05:00
parent 91c1e22324
commit 40ea61707f
No known key found for this signature in database
GPG Key ID: 0D414D0FE405B63B
3 changed files with 8 additions and 4 deletions

View File

@ -27,7 +27,7 @@ test:
soft-reset:
@echo "Soft-resetting Onionr..."
rm -f onionr/data/blocks/*.dat onionr/data/*.db | true > /dev/null 2>&1
rm -f onionr/data/blocks/*.dat onionr/data/*.db onionr/data/block-nonces.dat | true > /dev/null 2>&1
@./RUN-LINUX.sh version | grep -v "Failed" --color=always
reset:

View File

@ -186,6 +186,10 @@ class OnionrCommunicatorDaemon:
if blockHash in self.currentDownloading:
logger.debug('ALREADY DOWNLOADING ' + blockHash)
continue
if blockHash in self._core.getBlockList():
logger.debug('%s is already saved' % (blockHash,))
self.blockQueue.remove(blockHash)
continue
self.currentDownloading.append(blockHash)
logger.info("Attempting to download %s..." % blockHash)
peerUsed = self.pickOnlinePeer()

View File

@ -57,8 +57,8 @@
"blockCacheTotal": 50000000
},
"peers":{
"minimumScore": -1000,
"maxStoredPeers": 100,
"maxConnect": 3
"minimumScore": -100,
"maxStoredPeers": 500,
"maxConnect": 5
}
}