mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-10 20:01:20 +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