Find peer by lookup key

This commit is contained in:
ycc 2022-12-17 19:08:41 +01:00
parent 92f743b595
commit b50098d04e

View File

@ -50,6 +50,15 @@ func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
return nil
}
func (pl *PeerList) GetFromMyLookupKey(publickey string) *Peer {
for _, peer := range *pl {
if peer.MyLookupKp.Public == publickey {
return &peer
}
}
return nil
}
func (pl *PeerList) GetFromName(name string) *Peer {
for _, peer := range *pl {
if peer.Contact.Name == name {