diff options
| author | tv <tv@krebsco.de> | 2026-11-01 23:08:48 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-01 23:08:48 +0100 |
| commit | 8fc0bb43e15e9ffa99777e478162c101557d505b (patch) | |
| tree | a6a9e5ef95821b1539b7d28b873781e4e2e98633 /src/transport/libp2p/driver.rs | |
| parent | bc8e3afcd3eeb567661aa39d9d4cd6da1c57b29c (diff) | |
probe when reachable
Diffstat (limited to 'src/transport/libp2p/driver.rs')
| -rw-r--r-- | src/transport/libp2p/driver.rs | 10 |
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; } |
