Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion dash-spv/src/network/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,7 @@ impl PeerNetworkManager {
let mut dns_interval = time::interval_at(Instant::now() + DNS_DISCOVERY_DELAY, DNS_DISCOVERY_DELAY);
// Periodic reconnection check (active in both modes)
let mut maintenance_interval = time::interval(MAINTENANCE_INTERVAL);

let mut network_events = this.network_event_sender.subscribe();
while !this.shutdown_token.is_cancelled() {
tokio::select! {
_ = maintenance_interval.tick() => {
Expand All @@ -876,6 +876,19 @@ impl PeerNetworkManager {
_ = dns_interval.tick(), if !this.exclusive_mode => {
this.dns_fallback_tick().await;
}
event = network_events.recv() => {
match event {
Ok(event) => {
log::debug!("Network event in maintenance loop: {}", event.description());
dns_interval.reset();
this.maintenance_tick().await;
}
Err(error) => {
tracing::error!("Network event error: {}", error);
Comment thread
xdustinface marked this conversation as resolved.
break;
}
}
}
Comment thread
xdustinface marked this conversation as resolved.
_ = this.shutdown_token.cancelled() => {
log::info!("Maintenance loop shutting down");
break;
Expand Down
Loading