packages/hyprspace: PeX: return all known addresses for peer
This commit is contained in:
parent
e0aa5d5bdd
commit
dd45e676cd
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue