Change Peers to * Peers in identity to retrieve pointer to the real peer
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:
@ -4,12 +4,12 @@ import (
|
||||
"forge.redroom.link/yves/meowlib"
|
||||
)
|
||||
|
||||
type PeerList []Peer
|
||||
type PeerList []*Peer
|
||||
|
||||
func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
|
||||
for _, peer := range *pl {
|
||||
if peer.ContactPublicKey == publickey {
|
||||
return &peer
|
||||
return peer
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -18,7 +18,7 @@ func (pl *PeerList) GetFromPublicKey(publickey string) *Peer {
|
||||
func (pl *PeerList) GetFromMyLookupKey(publickey string) *Peer {
|
||||
for _, peer := range *pl {
|
||||
if peer.MyLookupKp.Public == publickey {
|
||||
return &peer
|
||||
return peer
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@ -27,7 +27,7 @@ func (pl *PeerList) GetFromMyLookupKey(publickey string) *Peer {
|
||||
func (pl *PeerList) GetFromName(name string) *Peer {
|
||||
for _, peer := range *pl {
|
||||
if peer.Name == name {
|
||||
return &peer
|
||||
return peer
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
Reference in New Issue
Block a user