-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Summary
When a listener tied to a relay reservation is closed, swarm doesn't emit the event indicating that the listener is closed, however the external address still persist. This happens because there is nothing in the relay client to remove the external address after the relay is closed except for when the connection itself is closed.
rust-libp2p/protocols/relay/src/priv_client.rs
Lines 150 to 155 in b433556
if let Some((addr, ReservationStatus::Confirmed)) = | |
self.reservation_addresses.remove(&connection_id) | |
{ | |
self.queued_actions | |
.push_back(ToSwarm::ExternalAddrExpired(addr)); | |
} |
Expected behavior
Remove external addresses after closing a listener tied to a relay
Actual behavior
Doesnt remove external addresses after closing a listener
Relevant log output
Possible Solution
When the transport closed the listener, we should also remove the external address as it would indicate that that the node is no longer reachable through the relay. Likely to be done by signaling the behaviour that the listener is closed and emit the event to remove the address.
Version
0.56
Would you like to work on fixing this bug?
Maybe