Find peer by lookup key
This commit is contained in:
parent
92f743b595
commit
b50098d04e
@ -50,6 +50,15 @@ func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
|
|||||||
return nil
|
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 {
|
func (pl *PeerList) GetFromName(name string) *Peer {
|
||||||
for _, peer := range *pl {
|
for _, peer := range *pl {
|
||||||
if peer.Contact.Name == name {
|
if peer.Contact.Name == name {
|
||||||
|
Loading…
Reference in New Issue
Block a user