From 72062ab86038dd8e8e5c0dc6eb5b536f3632fa0f Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Fri, 26 Jan 2018 20:31:11 -0800 Subject: [PATCH] we no longer use maps This technically worked, but was extremely misleading. --- p2p/host/peerstore/addr_manager.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/p2p/host/peerstore/addr_manager.go b/p2p/host/peerstore/addr_manager.go index 6f348f5952..8b06c484da 100644 --- a/p2p/host/peerstore/addr_manager.go +++ b/p2p/host/peerstore/addr_manager.go @@ -199,17 +199,17 @@ func (mgr *AddrManager) UpdateAddrs(p peer.ID, oldTTL time.Duration, newTTL time return } - amap, found := mgr.addrs[p] + addrs, found := mgr.addrs[p] if !found { return } exp := time.Now().Add(newTTL) - for addrstr, aexp := range amap { + for i := range addrs { + aexp := &addrs[i] if oldTTL == aexp.TTL { aexp.TTL = newTTL aexp.Expires = exp - amap[addrstr] = aexp } } }