mirror of
https://github.com/tendermint/tendermint.git
synced 2026-01-09 22:47:24 +00:00
p2p/trust: lock on Copy()
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user