fix: add missing lock

This commit is contained in:
Halimao 2024-06-30 18:12:15 +08:00
parent 7cfff30ba3
commit dac70fe3a4

View file

@ -58,6 +58,8 @@ func (w *Witness) fromExtWitness(ext *extWitness) error {
for _, code := range ext.Codes { for _, code := range ext.Codes {
w.Codes[string(code)] = struct{}{} w.Codes[string(code)] = struct{}{}
} }
w.lock.Lock()
defer w.lock.Unlock()
w.State = make(map[string]struct{}, len(ext.State)) w.State = make(map[string]struct{}, len(ext.State))
for _, node := range ext.State { for _, node := range ext.State {
w.State[string(node)] = struct{}{} w.State[string(node)] = struct{}{}