mirror of
https://github.com/logos-messaging/logos-messaging-go.git
synced 2026-01-07 00:13:13 +00:00
fix: setting peerId for store query (#1278)
This commit is contained in:
parent
e68fcdb554
commit
fdf03de179
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"github.com/libp2p/go-libp2p/core/host"
|
"github.com/libp2p/go-libp2p/core/host"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
|
libp2pPeerstore "github.com/libp2p/go-libp2p/core/peerstore"
|
||||||
libp2pProtocol "github.com/libp2p/go-libp2p/core/protocol"
|
libp2pProtocol "github.com/libp2p/go-libp2p/core/protocol"
|
||||||
"github.com/libp2p/go-msgio/pbio"
|
"github.com/libp2p/go-msgio/pbio"
|
||||||
"github.com/waku-org/go-waku/logging"
|
"github.com/waku-org/go-waku/logging"
|
||||||
@ -204,10 +205,14 @@ func (s *WakuStore) RequestRaw(ctx context.Context, peerInfo peer.AddrInfo, stor
|
|||||||
|
|
||||||
var params Parameters
|
var params Parameters
|
||||||
params.peerAddr = peerInfo.Addrs
|
params.peerAddr = peerInfo.Addrs
|
||||||
if len(params.peerAddr) == 0 {
|
params.selectedPeer = peerInfo.ID
|
||||||
|
if len(params.peerAddr) == 0 || params.selectedPeer == "" {
|
||||||
return nil, ErrMustSelectPeer
|
return nil, ErrMustSelectPeer
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Add Peer to peerstore.
|
||||||
|
s.h.Peerstore().AddAddrs(peerInfo.ID, peerInfo.Addrs, libp2pPeerstore.AddressTTL)
|
||||||
|
|
||||||
response, err := s.queryFrom(ctx, storeRequest, ¶ms)
|
response, err := s.queryFrom(ctx, storeRequest, ¶ms)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user