add nameexists to peers storage
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
e9624e4576
commit
118eb29d17
@ -193,6 +193,15 @@ func (ps *PeerStorage) GetFromMyLookupKey(publickey string) *Peer {
|
|||||||
return nil
|
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 {
|
func (ps *PeerStorage) GetFromName(name string) *Peer {
|
||||||
for _, peer := range ps.cache {
|
for _, peer := range ps.cache {
|
||||||
if peer.Name == name {
|
if peer.Name == name {
|
||||||
|
Loading…
Reference in New Issue
Block a user