fix(protocol): crash in concurrent map write/read
This commit is contained in:
parent
2dc1b48968
commit
33c46dd59d
|
@ -123,6 +123,9 @@ func (m *EnvelopesMonitor) Add(identifiers [][]byte, envelopeHashes []types.Hash
|
||||||
return errors.New("hashes don't match messages")
|
return errors.New("hashes don't match messages")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m.mu.Lock()
|
||||||
|
defer m.mu.Unlock()
|
||||||
|
|
||||||
for _, identifier := range identifiers {
|
for _, identifier := range identifiers {
|
||||||
m.identifierHashes[string(identifier)] = envelopeHashes
|
m.identifierHashes[string(identifier)] = envelopeHashes
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue