aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/driver.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-01 23:08:48 +0100
committertv <tv@krebsco.de>2026-11-01 23:08:48 +0100
commit7ca6a00cd3581e00686682af9010587028170cd5 (patch)
tree986ea138b3606ee4c8cb16b9dd05b8c3a8c23fda /src/transport/libp2p/driver.rs
parent7c58f3d8bfa87cfbc6c89ae34780e81b5ff47e0d (diff)
probe when reachable
Diffstat (limited to 'src/transport/libp2p/driver.rs')
-rw-r--r--src/transport/libp2p/driver.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/transport/libp2p/driver.rs b/src/transport/libp2p/driver.rs
index 39a2a5d..6ef04e7 100644
--- a/src/transport/libp2p/driver.rs
+++ b/src/transport/libp2p/driver.rs
@@ -420,6 +420,10 @@ pub(super) async fn run(
book.failed_relays.remove(&relay_peer_id);
if !renewal {
book.counts.slots_granted += 1;
+ // Peers that couldn't reach us may now, through it.
+ if let Some(reachable) = &book.reachable {
+ reachable.notify_one();
+ }
}
}
if !renewal {
@@ -440,6 +444,12 @@ pub(super) async fn run(
(Reachability::Public, Some(address.clone()))
}
};
+ if matches!(new, NatStatus::Public(_))
+ && !matches!(old, NatStatus::Public(_))
+ && let Some(reachable) = &book.reachable
+ {
+ reachable.notify_one();
+ }
}
nat = new;
}