From c469fec4e003c9fa4ad8649c912c7cb34d35c13e Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 15 May 2024 20:38:18 +0300 Subject: [PATCH] node: restart with 0 peers and running status --- src/node/node.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/node/node.rs b/src/node/node.rs index b327b21..51d593b 100644 --- a/src/node/node.rs +++ b/src/node/node.rs @@ -287,6 +287,12 @@ impl Node { NODE_STATE.starting.store(false, Ordering::Relaxed); 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 {