-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(iroh-gossip): make use of Endpoint::direct_addresses in iroh…
…_gossip::net (#2731) ## Description `iroh_gossip::net::Gossip` had a method to update the direct addresses of the iroh_net::Endpoint. IIRC that dates back when the Endpoint only exposed a single, non-cloneable stream of endpoint events, which was handled in the iroh Node and thus had to be forwarded to consumers like Gossip. This was long ago and by now the Endpoint provides a capable API for this. Therefore there is no need to expose this as a method (because Gossip always contains an Endpoint). <!-- A summary of what this pull request achieves and a rough list of changes. --> ## Breaking Changes `Gossip::update_direct_addresses` is removed. Updating the direct addresses is now handled by `Gossip` automatically. ## Notes & open questions To react to all updates to the endpoint's `NodeAddr`, I am watching both `Endpoint::direct_addresses` and `Endpoint::watch_home_relay`. A simpler API for this usecase would be `Endpoint::watch_node_addr`. <!-- Any notes, remarks or open questions you have to make about the PR. --> ## Change checklist - [x] Self-review. - [ ] Documentation updates following the [style guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text), if relevant. - [ ] Tests if relevant. - [x] All breaking changes documented.
- Loading branch information
Showing
2 changed files
with
34 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters