mirror of
https://github.com/yggdrasil-network/yggdrasil-go
synced 2024-11-13 00:40:24 +03:00
Merge pull request #284 from Arceliar/dht
insert a copy when calling dht.insertPeer
This commit is contained in:
commit
4e5906bf23
@ -145,7 +145,8 @@ func (t *dht) insertPeer(info *dhtInfo) {
|
|||||||
oldInfo, isIn := t.table[*info.getNodeID()]
|
oldInfo, isIn := t.table[*info.getNodeID()]
|
||||||
if !isIn || time.Since(oldInfo.recv) > dht_max_delay+30*time.Second {
|
if !isIn || time.Since(oldInfo.recv) > dht_max_delay+30*time.Second {
|
||||||
// TODO? also check coords?
|
// TODO? also check coords?
|
||||||
t.insert(info)
|
newInfo := *info // Insert a copy
|
||||||
|
t.insert(&newInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user