Merge pull request #23 from libp2p/fix/technically-not-broken

we no longer use maps
This commit is contained in:
Steven Allen 2018-01-27 17:39:41 +00:00 committed by GitHub
commit 54c3d5cb2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}
}
}