Make peer cleanup timings smoother
This commit is contained in:
		
							parent
							
								
									e41487f80c
								
							
						
					
					
						commit
						6f8a843e49
					
				
					 1 changed files with 2 additions and 4 deletions
				
			
		|  | @ -41,10 +41,8 @@ def peer_cleanup(): | |||
|             if peerprofiles.PeerProfiles(address).score < min_score: | ||||
|                 keydb.removekeys.remove_address(address) | ||||
|                 try: | ||||
|                     if (int(epoch.get_epoch()) - int(keydb.transportinfo.get_address_info(address, 'lastConnect'))) >= 600: | ||||
|                         expireTime = 600 | ||||
|                     else: | ||||
|                         expireTime = 86400 | ||||
|                     lastConnect = int(keydb.transportinfo.get_address_info(address, 'lastConnect')) | ||||
|                     expireTime = 86400 - int(epoch.get_epoch()) - lastConnect | ||||
|                     blacklist.addToDB(address, dataType=1, expire=expireTime) | ||||
|                 except sqlite3.IntegrityError: #TODO just make sure its not a unique constraint issue | ||||
|                     pass | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue