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

Fix minor stylistic MR comments

parent b5597c01
No related branches found
No related tags found
2 merge requests!510Release,!331Hotfix/dummy message clean up
......@@ -48,7 +48,6 @@ func (m *Manager) newRandomCmixMessage(rng csprng.Source) (
errors.Errorf(recipientRngErr, err)
}
// todo: use error constants above?
// Generate random message payload
payloadSize := m.store.GetCmixGroup().GetP().ByteLen()
payload, err = newRandomPayload(payloadSize, rng)
......@@ -124,7 +123,7 @@ func newRandomMAC(rng csprng.Source) ([]byte, error) {
}
//////////////////////////////////////////////////////////////////////////////////
// Random Duration functions
// Miscellaneous
//////////////////////////////////////////////////////////////////////////////////
// randomDuration returns a duration that is the base duration plus or minus a
......@@ -141,10 +140,6 @@ func randomDuration(base, randomRange time.Duration, rng csprng.Source) (
return base + randomRange - time.Duration(delta), nil
}
//////////////////////////////////////////////////////////////////////////////////
// Miscellaneous
//////////////////////////////////////////////////////////////////////////////////
// randomInt returns, as an int, a non-negative, non-zero random number in [1, n)
// from the csprng.Source.
func randomInt(n int, rng csprng.Source) (int, error) {
......
......@@ -101,7 +101,8 @@ func (m *Manager) sendMessages() error {
err = m.sendMessage(localIndex, totalMessages, rng)
if err != nil {
jww.ERROR.Printf(err.Error())
jww.ERROR.Printf("Failed to send message %d/%d: %+v",
localIndex, numMessages, err)
}
// Add to counter of successful sends
atomic.AddInt64(&sent, 1)
......@@ -119,16 +120,14 @@ func (m *Manager) sendMessage(index, totalMessages int, rng csprng.Source) error
// Generate message data
recipient, fp, service, payload, mac, err := m.newRandomCmixMessage(rng)
if err != nil {
return errors.Errorf("Failed to create dummy message %d/%d: %+v",
index, totalMessages, err)
return errors.Errorf("Failed to create random data: %+v", err)
}
// Send message
p := cmix.GetDefaultCMIXParams()
_, _, err = m.net.Send(recipient, fp, service, payload, mac, p)
if err != nil {
return errors.Errorf("Failed to send dummy message %d/%d: %+v",
index, totalMessages, err)
return errors.Errorf("Failed to send message: %+v", err)
}
return nil
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment