mirror of https://github.com/status-im/go-waku.git
fix(filter2): add requestID to pings and remove unneeded log (#776)
This commit is contained in:
parent
16ec22596e
commit
d324234c81
|
@ -359,7 +359,7 @@ func (wf *WakuFilterLightNode) Ping(ctx context.Context, peerID peer.ID) error {
|
||||||
|
|
||||||
return wf.request(
|
return wf.request(
|
||||||
ctx,
|
ctx,
|
||||||
&FilterSubscribeParameters{selectedPeer: peerID},
|
&FilterSubscribeParameters{selectedPeer: peerID, requestID: protocol.GenerateRequestID()},
|
||||||
pb.FilterSubscribeRequest_SUBSCRIBER_PING,
|
pb.FilterSubscribeRequest_SUBSCRIBER_PING,
|
||||||
ContentFilter{})
|
ContentFilter{})
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,6 @@ import (
|
||||||
"github.com/libp2p/go-libp2p/core/protocol"
|
"github.com/libp2p/go-libp2p/core/protocol"
|
||||||
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
|
"github.com/libp2p/go-libp2p/p2p/protocol/ping"
|
||||||
"github.com/multiformats/go-multiaddr"
|
"github.com/multiformats/go-multiaddr"
|
||||||
"github.com/waku-org/go-waku/logging"
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -62,7 +61,6 @@ func SelectRandomPeer(peers peer.IDSlice, log *zap.Logger) (peer.ID, error) {
|
||||||
if len(peers) >= 1 {
|
if len(peers) >= 1 {
|
||||||
peerID := peers[rand.Intn(len(peers))]
|
peerID := peers[rand.Intn(len(peers))]
|
||||||
// TODO: proper heuristic here that compares peer scores and selects "best" one. For now a random peer for the given protocol is returned
|
// TODO: proper heuristic here that compares peer scores and selects "best" one. For now a random peer for the given protocol is returned
|
||||||
log.Info("Got random peer from peerstore", logging.HostID("peer", peerID))
|
|
||||||
return peerID, nil // nolint: gosec
|
return peerID, nil // nolint: gosec
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue