From dd45e676cdc93ef21e6bbc960fd2206d08f0ad5d Mon Sep 17 00:00:00 2001 From: Max Date: Sat, 28 Jan 2023 13:32:35 +0100 Subject: [PATCH] packages/hyprspace: PeX: return all known addresses for peer --- packages/networking/hyprspace/p2p/pex.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/networking/hyprspace/p2p/pex.go b/packages/networking/hyprspace/p2p/pex.go index c13b340..1a6d5f9 100644 --- a/packages/networking/hyprspace/p2p/pex.go +++ b/packages/networking/hyprspace/p2p/pex.go @@ -57,8 +57,8 @@ func NewPeXStreamHandler(host host.Host, cfg *config.Config) func(network.Stream // peer requests addresses for _, p := range cfg.Peers { if p.ID != stream.Conn().RemotePeer() { - for _, c := range host.Network().ConnsToPeer(p.ID) { - _, err := stream.Write([]byte(fmt.Sprintf("%s|%s\n", c.RemotePeer().String(), c.RemoteMultiaddr().String()))) + for _, a := range host.Peerstore().Addrs(p.ID) { + _, err := stream.Write([]byte(fmt.Sprintf("%s|%s\n", p.ID, a))) if checkErrPeX(err, stream) { return }