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

removed the unregister return from registerListener

parent cf45cf39
No related branches found
No related tags found
No related merge requests found
...@@ -139,7 +139,8 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [ ...@@ -139,7 +139,8 @@ func NewPrecannedClient(precannedID uint, defJSON, storageDir string, password [
// Login initalizes a client object from existing storage. // Login initalizes a client object from existing storage.
func Login(storageDir string, password []byte) (*Client, error) { func Login(storageDir string, password []byte) (*Client, error) {
// Use fastRNG for RNG ops (AES fortuna based RNG using system RNG) // Use fastRNG for RNG ops (AES fortuna based RNG using system RNG)
rngStreamGen := fastRNG.NewStreamGenerator(12, 3, csprng.NewSystemRNG) rngStreamGen := fastRNG.NewStreamGenerator(12, 3,
csprng.NewSystemRNG)
// Load Storage // Load Storage
passwordStr := string(password) passwordStr := string(password)
......
...@@ -16,7 +16,6 @@ import ( ...@@ -16,7 +16,6 @@ import (
"gitlab.com/elixxir/primitives/states" "gitlab.com/elixxir/primitives/states"
"gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id"
"time" "time"
jww "github.com/spf13/jwalterweatherman"
) )
// BindingsClient wraps the api.Client, implementing additional functions // BindingsClient wraps the api.Client, implementing additional functions
...@@ -145,12 +144,12 @@ func (c *Client) RegisterNetworkHealthCB(nhc NetworkHealthCallback) { ...@@ -145,12 +144,12 @@ func (c *Client) RegisterNetworkHealthCB(nhc NetworkHealthCallback) {
// Message Types can be found in client/interfaces/message/type.go // Message Types can be found in client/interfaces/message/type.go
// Make sure to not conflict with ANY default message types // Make sure to not conflict with ANY default message types
func (c *Client) RegisterListener(uid []byte, msgType int, func (c *Client) RegisterListener(uid []byte, msgType int,
listener Listener) (Unregister, error) { listener Listener) error {
name := listener.Name() name := listener.Name()
u, err := id.Unmarshal(uid) u, err := id.Unmarshal(uid)
if err != nil { if err != nil {
return Unregister{}, err return err
} }
mt := message.Type(msgType) mt := message.Type(msgType)
...@@ -158,9 +157,9 @@ func (c *Client) RegisterListener(uid []byte, msgType int, ...@@ -158,9 +157,9 @@ func (c *Client) RegisterListener(uid []byte, msgType int,
listener.Hear(item) listener.Hear(item)
} }
lid := c.api.GetSwitchboard().RegisterFunc(name, u, mt, f) c.api.GetSwitchboard().RegisterFunc(name, u, mt, f)
return newListenerUnregister(lid, c.api.GetSwitchboard()), nil return nil
} }
// RegisterRoundEventsHandler registers a callback interface for round // RegisterRoundEventsHandler registers a callback interface for round
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment