Skip to content
Snippets Groups Projects
Commit d48f8405 authored by Josh Brooks's avatar Josh Brooks
Browse files

Fix bug

parent 678f6278
Branches
Tags
2 merge requests!510Release,!333Frond End Assistance And Iterative Clean Up
...@@ -4,7 +4,6 @@ import ( ...@@ -4,7 +4,6 @@ import (
"github.com/pkg/errors" "github.com/pkg/errors"
"gitlab.com/elixxir/crypto/contact" "gitlab.com/elixxir/crypto/contact"
"gitlab.com/xx_network/comms/connect" "gitlab.com/xx_network/comms/connect"
"gitlab.com/xx_network/primitives/id"
"time" "time"
) )
...@@ -23,35 +22,26 @@ func (m *Manager) setUserDiscovery(cert, ...@@ -23,35 +22,26 @@ func (m *Manager) setUserDiscovery(cert,
params.AuthEnabled = false params.AuthEnabled = false
params.SendTimeout = 20 * time.Second params.SendTimeout = 20 * time.Second
udIdBytes, dhPubKeyBytes, err := contact.ReadContactFromFile(contactFile) // Unmarshal the new contact
if err != nil { con, err := contact.Unmarshal(contactFile)
return err
}
udID, err := id.Unmarshal(udIdBytes)
if err != nil { if err != nil {
return err return err
} }
// Add a new host and return it if it does not already exist // Add a new host and return it if it does not already exist
host, err := m.comms.AddHost(udID, address, host, err := m.comms.AddHost(con.ID, address,
cert, params) cert, params)
if err != nil { if err != nil {
return errors.WithMessage(err, "User Discovery host object could "+ return errors.WithMessage(err, "User Discovery host object could "+
"not be constructed.") "not be constructed.")
} }
dhPubKey := m.user.GetE2E().GetGroup().NewInt(1) // Set the user discovery object within the manager
err = dhPubKey.UnmarshalJSON(dhPubKeyBytes)
if err != nil {
return err
}
m.ud = &userDiscovery{ m.ud = &userDiscovery{
host: host, host: host,
contact: contact.Contact{ contact: contact.Contact{
ID: udID, ID: con.ID,
DhPubKey: dhPubKey, DhPubKey: con.DhPubKey,
}, },
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment