diff --git a/cluster/cluster.go b/cluster/cluster.go index 57d82bdc..322481ea 100644 --- a/cluster/cluster.go +++ b/cluster/cluster.go @@ -260,8 +260,8 @@ func (p *Peer) setInitialFailed(peers []string, myAddr string) { return } - p.peerLock.RLock() - defer p.peerLock.RUnlock() + p.peerLock.Lock() + defer p.peerLock.Unlock() now := time.Now() for _, peerAddr := range peers {