- Thread magnet start if not connected

- Don't lose all DHT peers if we stop quickly
- Explore a kbucket if it's less than 3/4 full
- Change release torrent file names
This commit is contained in:
zzz
2012-10-23 19:34:35 +00:00
parent bb2363f68a
commit 2f69d16828
5 changed files with 13 additions and 7 deletions

View File

@@ -518,6 +518,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
/**
* For every bucket that hasn't been updated in this long,
* or isn't close to full,
* generate a random key that would be a member of that bucket.
* The returned keys may be searched for to "refresh" the buckets.
* @return non-null, closest first
@@ -528,7 +529,7 @@ public class KBucketSet<T extends SimpleDataStructure> {
getReadLock();
try {
for (KBucket b : _buckets) {
if (b.getLastChanged() < old)
if (b.getLastChanged() < old || b.getKeyCount() < BUCKET_SIZE * 3 / 4)
rv.add(generateRandomKey(b));
}
} finally { releaseReadLock(); }