mirror of
https://github.com/libp2p/go-libp2p-peerstore.git
synced 2024-12-28 23:50:12 +08:00
Flatten loops
This commit is contained in:
parent
299007e9ca
commit
5f74828c53
@ -71,10 +71,10 @@ func (mgr *DatastoreAddrManager) SetAddrs(p peer.ID, addrs []ma.Multiaddr, ttl t
|
||||
|
||||
if ttl <= 0 {
|
||||
mgr.ds.Delete(key)
|
||||
} else {
|
||||
if err := mgr.ds.Put(key, addr.Bytes()); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
continue
|
||||
}
|
||||
if err := mgr.ds.Put(key, addr.Bytes()); err != nil {
|
||||
log.Error(err)
|
||||
}
|
||||
}
|
||||
mgr.ttlManager.setTTLs(keys, ttl)
|
||||
|
Loading…
Reference in New Issue
Block a user