mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-17 23:21:21 +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
|
// Copy returns a new trust metric with members containing the same values
|
||||||
func (tm *TrustMetric) Copy() *TrustMetric {
|
func (tm *TrustMetric) Copy() *TrustMetric {
|
||||||
|
tm.mtx.Lock()
|
||||||
|
defer tm.mtx.Unlock()
|
||||||
if tm == nil {
|
if tm == nil {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user