mirror of
https://github.com/status-im/status-go.git
synced 2025-02-16 08:50:09 +00:00
fix: no peers discovered
This commit is contained in:
parent
881da9e654
commit
7eeeb07cab
@ -551,7 +551,6 @@ func (w *Waku) runPeerExchangeLoop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
w.dnsAddressCacheLock.RUnlock()
|
w.dnsAddressCacheLock.RUnlock()
|
||||||
time.Sleep(5 * time.Second)
|
|
||||||
err := w.node.PeerExchange().Request(w.ctx, peersToDiscover, peer_exchange.WithAutomaticPeerSelection())
|
err := w.node.PeerExchange().Request(w.ctx, peersToDiscover, peer_exchange.WithAutomaticPeerSelection())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
w.logger.Error("couldnt request peers via peer exchange", zap.Error(err))
|
w.logger.Error("couldnt request peers via peer exchange", zap.Error(err))
|
||||||
|
@ -268,7 +268,11 @@ func TestPeerExchange(t *testing.T) {
|
|||||||
b.MaxElapsedTime = 30 * time.Second
|
b.MaxElapsedTime = 30 * time.Second
|
||||||
}
|
}
|
||||||
err = tt.RetryWithBackOff(func() error {
|
err = tt.RetryWithBackOff(func() error {
|
||||||
if len(lightNode.Peers()) == 2 {
|
// we should not use lightNode.Peers() here as it only indicates peers that are connected right now,
|
||||||
|
// in light client mode,the peer will be closed via `w.node.Host().Network().ClosePeer(peerInfo.ID)`
|
||||||
|
// after invoking identifyAndConnect, instead, we should check the peerStore, peers from peerStore
|
||||||
|
// won't get deleted especially if they are statically added.
|
||||||
|
if len(lightNode.node.Host().Peerstore().Peers()) == 2 {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return errors.New("no peers discovered")
|
return errors.New("no peers discovered")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user