Skip to content

Commit

Permalink
Merge pull request #23 from libp2p/fix/technically-not-broken
Browse files Browse the repository at this point in the history
we no longer use maps
  • Loading branch information
Stebalien committed Jan 27, 2018
2 parents c6c7b61 + 72062ab commit fd4d308
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions p2p/host/peerstore/addr_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Expand Down

0 comments on commit fd4d308

Please sign in to comment.