Fix data races in timers

This commit is contained in:
Jason A. Donenfeld
2018-05-20 06:50:07 +02:00
parent 18f43705ec
commit acb5481246
4 changed files with 17 additions and 17 deletions

View File

@ -124,7 +124,7 @@ func (peer *Peer) SendKeepalive() bool {
func (peer *Peer) SendHandshakeInitiation(isRetry bool) error {
if !isRetry {
peer.timers.handshakeAttempts = 0
atomic.StoreUint32(&peer.timers.handshakeAttempts, 0)
}
peer.handshake.mutex.RLock()