From 67ac969a65b9d54c6c3c7a4284f7169359839737 Mon Sep 17 00:00:00 2001 From: Vitaliy Vlasov Date: Sat, 18 Sep 2021 17:19:19 +0300 Subject: [PATCH] Use peerstore instead of network --- waku/v2/node/wakunode2.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/waku/v2/node/wakunode2.go b/waku/v2/node/wakunode2.go index f38e55b3..9618c481 100644 --- a/waku/v2/node/wakunode2.go +++ b/waku/v2/node/wakunode2.go @@ -780,7 +780,11 @@ func (w *WakuNode) startKeepAlive(t time.Duration) { for { select { case <-ticker.C: - for _, p := range w.host.Network().Peers() { + for _, p := range w.host.Peerstore().Peers() { + if p == w.host.ID() { + log.Info("###PING skip ", p) + continue + } mu.Lock() _, ok := peerMap[p] mu.Unlock()