OSDN Git Service

use__write_lock_for_take_over_instance (#2112)
[bytom/bytom.git] / contract / trace_service.go
index 3104ea1..ff5d109 100644 (file)
@@ -178,8 +178,8 @@ func (t *TraceService) GetInstance(traceID string) (*Instance, error) {
 }
 
 func (t *TraceService) takeOverInstances(instances []*Instance, blockHash bc.Hash) bool {
-       t.RLock()
-       defer t.RUnlock()
+       t.Lock()
+       defer t.Unlock()
 
        if blockHash != t.bestHash {
                return false