Use getRecentPeers for listModification
This commit is contained in:
parent
adbaadae81
commit
fd365a19f7
1 changed files with 4 additions and 5 deletions
|
@ -329,11 +329,10 @@ class Site(object):
|
||||||
if self.peers:
|
if self.peers:
|
||||||
break
|
break
|
||||||
|
|
||||||
for peer in self.peers.itervalues(): # Try to find connected good peers, but we must have at least 5 peers
|
peers_try = self.getConnectedPeers()
|
||||||
if peer.findConnection() and peer.connection.handshake.get("rev", 0) > 125: # Add to the beginning if rev125
|
peers_connected_num = len(peers_try)
|
||||||
peers_try.insert(0, peer)
|
if peers_connected_num < limit * 2: # Add more, non-connected peers if necessary
|
||||||
elif len(peers_try) < 5: # Backup peers, add to end of the try list
|
peers_try += self.getRecentPeers(limit * 5)
|
||||||
peers_try.append(peer)
|
|
||||||
|
|
||||||
if since is None: # No since defined, download from last modification time-1day
|
if since is None: # No since defined, download from last modification time-1day
|
||||||
since = self.settings.get("modified", 60 * 60 * 24) - 60 * 60 * 24
|
since = self.settings.get("modified", 60 * 60 * 24) - 60 * 60 * 24
|
||||||
|
|
Loading…
Reference in a new issue