Browse Source

p2p/trust: lock on Copy()

pull/917/head
Ethan Buchman 7 years ago
parent
commit
cb9a1dbb4f
1 changed files with 2 additions and 0 deletions
  1. +2
    -0
      p2p/trust/metric.go

+ 2
- 0
p2p/trust/metric.go View File

@ -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
}


Loading…
Cancel
Save