fix federation recovery after network suspension
CI / check (push) Successful in 1m13s

This commit is contained in:
Ultradesu committed 2026-09-02 15:09:16 +01:00
1 parent 02ef0095f5
commit 95bcc9bac4
12 files changed
+342 -63

No files matched your search

+7 -2
View File
@@ -5,8 +5,8 @@ use std::sync::Arc;
use std::time::{Duration, Instant};
use federation_net::{
ByteStream, EndpointAddr, EndpointId, NetworkConfig, NetworkEngine, NetworkId, PeerTicket,
SchemaId, SecretKey, Signature, StreamAcceptor,
ByteStream, EndpointAddr, EndpointId, NetworkConfig, NetworkEngine, NetworkHealthSnapshot,
NetworkId, PeerTicket, SchemaId, SecretKey, Signature, StreamAcceptor,
};
use tokio::sync::mpsc;
use tokio::task::JoinHandle;
@@ -375,6 +375,11 @@ impl MusicDhtService {
self.node.engine.connected_peers()
}
/// Returns a point-in-time snapshot of transport and rendezvous health.
pub fn network_health(&self) -> NetworkHealthSnapshot {
self.node.engine.health()
}
/// Returns `true` if a transport connection to `peer` is open.
pub fn is_connected(&self, peer: EndpointId) -> bool {
self.node.engine.is_connected(peer)