Skip to content
Snippets Groups Projects
Commit 5ee6cd8f authored by Benjamin Wenger's avatar Benjamin Wenger
Browse files

added HasAuthenticatedChannel

parent d0790967
No related merge requests found
......@@ -4,6 +4,7 @@ import (
jww "github.com/spf13/jwalterweatherman"
"gitlab.com/elixxir/client/interfaces/contact"
"gitlab.com/elixxir/client/storage/e2e"
"gitlab.com/xx_network/primitives/id"
)
// CreateAuthenticatedChannel creates a 1-way authenticated channel
......@@ -31,6 +32,13 @@ func (c *Client) RegisterAuthRequestCb(cb func(contact contact.Contact,
jww.INFO.Printf("RegisterAuthRequestCb(...)")
}
// HasAuthenticatedChannel returns true if an authenticated channel exists for
// the partner
func (c *Client) HasAuthenticatedChannel(partner *id.ID) bool {
m, err := c.storage.E2e().GetPartner(partner)
return m != nil && err == nil
}
// Create an insecure e2e relationship with a precanned user
func (c *Client) MakePrecannedAuthenticatedChannel(precannedID uint) (contact.Contact, error) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment