forked from I2P_Developers/i2p.i2p
- 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:
@@ -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(); }
|
||||
|
||||
Reference in New Issue
Block a user