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

fixed non local access to the output of a for loop

parent f12bb7e3
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import (
ds "gitlab.com/elixxir/comms/network/dataStructures"
"gitlab.com/elixxir/primitives/format"
"gitlab.com/elixxir/primitives/states"
"gitlab.com/xx_network/primitives/id"
"time"
)
......@@ -83,7 +84,8 @@ func (m *Manager) criticalMessages() {
param := params.GetDefaultCMIX()
//raw critical messages
for msg, rid, has := critRawMsgs.Next(); has; msg, rid, has = critRawMsgs.Next() {
go func(msg format.Message) {
localRid := rid.DeepCopy()
go func(msg format.Message, rid *id.ID) {
//send the message
round, _, err := m.SendCMIX(msg, rid, param)
//if the message fail to send, notify the buffer so it can be handled
......@@ -112,7 +114,7 @@ func (m *Manager) criticalMessages() {
return
}
critRawMsgs.Succeeded(msg, rid)
}(msg)
}(msg, localRid)
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment