From 118eb29d17c3dbc037eb5679f2d3d508b2659b6d Mon Sep 17 00:00:00 2001 From: ycc Date: Tue, 28 May 2024 20:19:58 +0200 Subject: [PATCH] add nameexists to peers storage --- client/peerstorage.go | 9 +++++++++ 1 file changed, 9 insertions(+) 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 {