aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/driver.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-31 20:51:53 +0100
committertv <tv@krebsco.de>2026-10-31 20:51:53 +0100
commit491b24d27c2e70d2197c5cd16397967232f087fe (patch)
tree0dd860c27c83bfd2e8de6a07d4b7abdd2382a385 /src/transport/libp2p/driver.rs
parent468112d27b272214e0dbec08c662c39826eb684a (diff)
libp2p: identify replaces addresses
Diffstat (limited to 'src/transport/libp2p/driver.rs')
-rw-r--r--src/transport/libp2p/driver.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/transport/libp2p/driver.rs b/src/transport/libp2p/driver.rs
index 37eae35..a450cb0 100644
--- a/src/transport/libp2p/driver.rs
+++ b/src/transport/libp2p/driver.rs
@@ -218,6 +218,9 @@ pub(super) async fn run(
let mut book = lock(&book);
book.connections.remove(&connection_id);
book.rtts.remove(&connection_id);
+ if book.connection(&peer_id).is_none() {
+ book.identified.remove(&peer_id);
+ }
}
let cause = match cause {
_ if closing_duplicates.remove(&connection_id) => "a duplicate".to_owned(),
@@ -462,10 +465,7 @@ pub(super) async fn run(
"Peer identified"
);
}
- // Last first: `remember` puts each in front.
- for address in listen.into_iter().rev() {
- book.remember(peer_id, address);
- }
+ book.identified(peer_id, listen);
if relaying.public
&& info.protocols.contains(&::libp2p::relay::HOP_PROTOCOL_NAME)
&& (book.public_relays.len() < MAX_PEERS