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
|
// peer requests addresses
|
||||||
for _, p := range cfg.Peers {
|
for _, p := range cfg.Peers {
|
||||||
if p.ID != stream.Conn().RemotePeer() {
|
if p.ID != stream.Conn().RemotePeer() {
|
||||||
for _, c := range host.Network().ConnsToPeer(p.ID) {
|
for _, a := range host.Peerstore().Addrs(p.ID) {
|
||||||
_, err := stream.Write([]byte(fmt.Sprintf("%s|%s\n", c.RemotePeer().String(), c.RemoteMultiaddr().String())))
|
_, err := stream.Write([]byte(fmt.Sprintf("%s|%s\n", p.ID, a)))
|
||||||
if checkErrPeX(err, stream) {
|
if checkErrPeX(err, stream) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue