mirror of https://github.com/status-im/go-waku.git
fix: add back to peerstore dns4 addresses removed by go-libp2p identify
This commit is contained in:
parent
215c7c46b6
commit
e8bd38a023
|
@ -740,6 +740,20 @@ func (w *WakuNode) connect(ctx context.Context, info peer.AddrInfo) error {
|
|||
return err
|
||||
}
|
||||
|
||||
for _, addr := range info.Addrs {
|
||||
// TODO: this is a temporary fix
|
||||
// host.Connect adds the addresses with a TempAddressTTL
|
||||
// however, identify will filter out all non IP addresses
|
||||
// and expire all temporary addrs. So in the meantime, let's
|
||||
// store dns4 addresses with a connectedAddressTTL, otherwise
|
||||
// it will have trouble with the status fleet circuit relay addresses
|
||||
// See https://github.com/libp2p/go-libp2p/issues/2550
|
||||
_, err := addr.ValueForProtocol(ma.P_DNS4)
|
||||
if err == nil {
|
||||
w.host.Peerstore().AddAddrs(info.ID, info.Addrs, peerstore.ConnectedAddrTTL)
|
||||
}
|
||||
}
|
||||
|
||||
w.host.Peerstore().(wps.WakuPeerstore).ResetConnFailures(info)
|
||||
|
||||
w.metrics.RecordDial()
|
||||
|
|
Loading…
Reference in New Issue