add nameexists to peers storage
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
ycc 2024-05-28 20:19:58 +02:00
parent e9624e4576
commit 118eb29d17

View File

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