mirror of
https://github.com/yggdrasil-network/yggdrasil-go.git
synced 2024-12-03 15:05:25 +00:00
don't add things to the dht rumorMill if they've been pinged in the last minute (arbitrary time, needs investigating)
This commit is contained in:
parent
96399d586d
commit
fe5ef4e867
@ -451,7 +451,7 @@ func (t *dht) doMaintenance() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if oldest != nil {
|
if oldest != nil && time.Since(oldest.recv) > time.Minute {
|
||||||
t.addToMill(oldest, nil)
|
t.addToMill(oldest, nil)
|
||||||
} // if the DHT isn't empty
|
} // if the DHT isn't empty
|
||||||
// Refresh buckets
|
// Refresh buckets
|
||||||
@ -460,9 +460,11 @@ func (t *dht) doMaintenance() {
|
|||||||
}
|
}
|
||||||
target := t.getTarget(t.offset)
|
target := t.getTarget(t.offset)
|
||||||
for _, info := range t.lookup(target) {
|
for _, info := range t.lookup(target) {
|
||||||
|
if time.Since(info.recv) > time.Minute {
|
||||||
t.addToMill(info, target)
|
t.addToMill(info, target)
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
}
|
||||||
t.offset++
|
t.offset++
|
||||||
}
|
}
|
||||||
if len(t.rumorMill) > 0 {
|
if len(t.rumorMill) > 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user