fix: do not self-ping

This commit is contained in:
Richard Ramos 2021-11-09 15:33:24 -04:00
parent 27c339614f
commit 2f55784db7
No known key found for this signature in database
GPG Key ID: 80D4B01265FDFE8F

View File

@ -416,7 +416,9 @@ func (w *WakuNode) startKeepAlive(t time.Duration) {
// which is not possible when iterating
// through Network's peer collection, as it will be empty
for _, p := range w.host.Peerstore().Peers() {
go pingPeer(w.ctx, w.ping, p)
if p != w.host.ID() {
go pingPeer(w.ctx, w.ping, p)
}
}
case <-w.quit:
ticker.Stop()