From b50098d04e41e8ea6ab7b94728a3b481e5c53743 Mon Sep 17 00:00:00 2001 From: ycc Date: Sat, 17 Dec 2022 19:08:41 +0100 Subject: [PATCH] Find peer by lookup key --- client/peer.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/peer.go b/client/peer.go index 20540b6..c435a92 100644 --- a/client/peer.go +++ b/client/peer.go @@ -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 {