aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/libp2p/driver.rs
diff options
context:
space:
mode:
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;
}