Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webrtc): Don't append /p2p to listen addresses #3154

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions transports/webrtc/src/tokio/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,7 @@ impl ListenStream {
{
return Poll::Ready(TransportEvent::NewAddress {
listener_id: self.listener_id,
listen_addr: self
.listen_multiaddress(ip, self.config.id_keys.public().to_peer_id()),
listen_addr: self.listen_multiaddress(ip),
});
}
}
Expand All @@ -272,8 +271,7 @@ impl ListenStream {
{
return Poll::Ready(TransportEvent::AddressExpired {
listener_id: self.listener_id,
listen_addr: self
.listen_multiaddress(ip, self.config.id_keys.public().to_peer_id()),
listen_addr: self.listen_multiaddress(ip),
});
}
}
Expand All @@ -290,11 +288,10 @@ impl ListenStream {
}

/// Constructs a [`Multiaddr`] for the given IP address that represents our listen address.
fn listen_multiaddress(&self, ip: IpAddr, local_peer_id: PeerId) -> Multiaddr {
fn listen_multiaddress(&self, ip: IpAddr) -> Multiaddr {
let socket_addr = SocketAddr::new(ip, self.listen_addr.port());

socketaddr_to_multiaddr(&socket_addr, Some(self.config.fingerprint))
.with(Protocol::P2p(*local_peer_id.as_ref()))
}
}

Expand Down