From 50ed92d6d2cc0a54e819bb3f624fe6d390dc91c7 Mon Sep 17 00:00:00 2001 From: Arceliar Date: Wed, 26 Dec 2018 00:18:51 -0600 Subject: [PATCH] insert a copy when calling dht.insertPeer --- src/yggdrasil/dht.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/yggdrasil/dht.go b/src/yggdrasil/dht.go index 9688394..b52a820 100644 --- a/src/yggdrasil/dht.go +++ b/src/yggdrasil/dht.go @@ -145,7 +145,8 @@ func (t *dht) insertPeer(info *dhtInfo) { oldInfo, isIn := t.table[*info.getNodeID()] if !isIn || time.Since(oldInfo.recv) > dht_max_delay+30*time.Second { // TODO? also check coords? - t.insert(info) + newInfo := *info // Insert a copy + t.insert(&newInfo) } }