node: restart with 0 peers and running status

This commit is contained in:
ardocrat 2024-05-15 20:38:18 +03:00
parent 2bb51d6757
commit c469fec4e0

View file

@ -287,6 +287,12 @@ impl Node {
NODE_STATE.starting.store(false, Ordering::Relaxed); NODE_STATE.starting.store(false, Ordering::Relaxed);
first_start = false; first_start = false;
} }
// Restart node on running status and 0 peers (usual case for Mobile).
if stats.peer_count == 0 && stats.sync_status == SyncStatus::NoSync {
Node::restart();
continue;
}
} }
if stratum_start_requested && NODE_STATE.stratum_stats.read().is_running { if stratum_start_requested && NODE_STATE.stratum_stats.read().is_running {