diff --git a/p2p/trust/metric.go b/p2p/trust/metric.go index 3b4c6dd12..beb462b20 100644 --- a/p2p/trust/metric.go +++ b/p2p/trust/metric.go @@ -234,6 +234,8 @@ func (tm *TrustMetric) NextTimeInterval() { // Copy returns a new trust metric with members containing the same values func (tm *TrustMetric) Copy() *TrustMetric { + tm.mtx.Lock() + defer tm.mtx.Unlock() if tm == nil { return nil }