summaryrefslogtreecommitdiffstats
path: root/src/transport/identity.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/transport/identity.rs')
-rw-r--r--src/transport/identity.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/transport/identity.rs b/src/transport/identity.rs
index 502c6b3..432348e 100644
--- a/src/transport/identity.rs
+++ b/src/transport/identity.rs
@@ -474,6 +474,20 @@ impl Transport for IdentityTransport {
self.shared.paths.local_addresses()
}
+ fn identities_of(&self, peer: &str) -> Vec<String> {
+ if peer == self.shared.node_id {
+ return self.shared.paths.own_addresses();
+ }
+ let book = self.shared.lock();
+ let mut addresses = book.proven.get(peer).cloned().unwrap_or_default();
+ for hint in book.hints.get(peer).into_iter().flatten() {
+ if !addresses.contains(hint) {
+ addresses.push(hint.clone());
+ }
+ }
+ addresses
+ }
+
/// Where `peer` proved itself, else where it is said to be, as others can use it.
fn addresses_of(&self, peer: &str) -> Vec<String> {
let addresses = {