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

Multiaddr duplicated p2p protocol in relay reservation (#2696) #2701

Merged
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions protocols/relay/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

- Update to `libp2p-swarm` `v0.37.0`.

- Do not duplicate the p2p/xxx component with the relay PeerId when a client requests a reservation. See [PR 2701].

[PR 2701]: https://github.com/libp2p/rust-libp2p/pull/2701/

# 0.9.1

- Respond to at most one incoming reservation request. Deny <= 8 incoming
Expand Down
10 changes: 7 additions & 3 deletions protocols/relay/src/v2/relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,9 +756,13 @@ impl Action {
inbound_reservation_req,
addrs: poll_parameters
.external_addresses()
.map(|a| {
a.addr
.with(Protocol::P2p((*poll_parameters.local_peer_id()).into()))
.map(|a| a.addr)
// Add local peer ID in case it isn't present yet.
.filter_map(|a| match a.iter().last()? {
Protocol::P2p(_) => Some(a),
_ => Some(
a.with(Protocol::P2p(*poll_parameters.local_peer_id().as_ref())),
),
})
.collect(),
}),
Expand Down