From 8fc0bb43e15e9ffa99777e478162c101557d505b Mon Sep 17 00:00:00 2001 From: tv Date: Sun, 1 Nov 2026 23:08:48 +0100 Subject: probe when reachable --- src/transport/libp2p/driver.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/transport/libp2p/driver.rs') 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; } -- cgit v1.3.1