Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(share/discovery): discovery should try to connect to empty hosts …
…peers (celestiaorg#2575) libp2p routed host will attempt to find address, if none are provided. First in `Peerstore`, then by calling `FindPeer`: ``` // if we were given some addresses, keep + use them. if len(pi.Addrs) > 0 { rh.Peerstore().AddAddrs(pi.ID, pi.Addrs, peerstore.TempAddrTTL) } // Check if we have some addresses in our recent memory. addrs := rh.Peerstore().Addrs(pi.ID) if len(addrs) < 1 { // no addrs? find some with the routing system. var err error addrs, err = rh.findPeerAddrs(ctx, pi.ID) if err != nil { return err } } ``` It is worth to try to connect in such case. (cherry picked from commit c2c0827)
- Loading branch information