diff --git a/client/peerstorage.go b/client/peerstorage.go index cb5a908..59488b6 100644 --- a/client/peerstorage.go +++ b/client/peerstorage.go @@ -193,6 +193,15 @@ func (ps *PeerStorage) GetFromMyLookupKey(publickey string) *Peer { return nil } +func (ps *PeerStorage) NameExists(name string) bool { + for _, peer := range ps.cache { + if peer.Name == name { + return true + } + } + return false +} + func (ps *PeerStorage) GetFromName(name string) *Peer { for _, peer := range ps.cache { if peer.Name == name {