do not try to download already saved blocks from upload
This commit is contained in:
		
							parent
							
								
									91c1e22324
								
							
						
					
					
						commit
						40ea61707f
					
				
					 3 changed files with 8 additions and 4 deletions
				
			
		
							
								
								
									
										2
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
										
									
									
									
								
							| 
						 | 
					@ -27,7 +27,7 @@ test:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
soft-reset:
 | 
					soft-reset:
 | 
				
			||||||
	@echo "Soft-resetting Onionr..."
 | 
						@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
 | 
						@./RUN-LINUX.sh version | grep -v "Failed" --color=always
 | 
				
			||||||
 | 
					
 | 
				
			||||||
reset:
 | 
					reset:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -186,6 +186,10 @@ class OnionrCommunicatorDaemon:
 | 
				
			||||||
            if blockHash in self.currentDownloading:
 | 
					            if blockHash in self.currentDownloading:
 | 
				
			||||||
                logger.debug('ALREADY DOWNLOADING ' + blockHash)
 | 
					                logger.debug('ALREADY DOWNLOADING ' + blockHash)
 | 
				
			||||||
                continue
 | 
					                continue
 | 
				
			||||||
 | 
					            if blockHash in self._core.getBlockList():
 | 
				
			||||||
 | 
					                logger.debug('%s is already saved' % (blockHash,))
 | 
				
			||||||
 | 
					                self.blockQueue.remove(blockHash)
 | 
				
			||||||
 | 
					                continue
 | 
				
			||||||
            self.currentDownloading.append(blockHash)
 | 
					            self.currentDownloading.append(blockHash)
 | 
				
			||||||
            logger.info("Attempting to download %s..." % blockHash)
 | 
					            logger.info("Attempting to download %s..." % blockHash)
 | 
				
			||||||
            peerUsed = self.pickOnlinePeer()
 | 
					            peerUsed = self.pickOnlinePeer()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,8 +57,8 @@
 | 
				
			||||||
        "blockCacheTotal": 50000000
 | 
					        "blockCacheTotal": 50000000
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    "peers":{
 | 
					    "peers":{
 | 
				
			||||||
        "minimumScore": -1000,
 | 
					        "minimumScore": -100,
 | 
				
			||||||
        "maxStoredPeers": 100,
 | 
					        "maxStoredPeers": 500,
 | 
				
			||||||
        "maxConnect": 3
 | 
					        "maxConnect": 5
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue