mirror of https://github.com/status-im/go-waku.git
fix: add lock when deleting peer
This commit is contained in:
parent
d4473e9c46
commit
5ff87d8e65
|
@ -86,7 +86,9 @@ func (w *WakuNode) pingPeer(ctx context.Context, wg *sync.WaitGroup, peer peer.I
|
||||||
w.keepAliveMutex.Unlock()
|
w.keepAliveMutex.Unlock()
|
||||||
logger.Debug("could not ping", zap.Error(res.Error))
|
logger.Debug("could not ping", zap.Error(res.Error))
|
||||||
} else {
|
} else {
|
||||||
|
w.keepAliveMutex.Lock()
|
||||||
delete(w.keepAliveFails, peer)
|
delete(w.keepAliveFails, peer)
|
||||||
|
w.keepAliveMutex.Unlock()
|
||||||
}
|
}
|
||||||
case <-ctx.Done():
|
case <-ctx.Done():
|
||||||
w.keepAliveMutex.Lock()
|
w.keepAliveMutex.Lock()
|
||||||
|
|
Loading…
Reference in New Issue