From 842caa25e18c044e20bb0c9891b691a2cb63bda5 Mon Sep 17 00:00:00 2001 From: dasman Date: Sat, 27 Sep 2025 05:57:01 +0300 Subject: [PATCH] event_graph: fix already sync check --- src/event_graph/mod.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/event_graph/mod.rs b/src/event_graph/mod.rs index ad7ed8471..9268604ac 100644 --- a/src/event_graph/mod.rs +++ b/src/event_graph/mod.rs @@ -552,22 +552,20 @@ impl EventGraph { } drop(tips); - if fast_mode { - // Now begin fetching the events backwards. - let mut missing_parents = HashSet::new(); - for tip in considered_tips.iter() { - assert!(tip != &NULL_ID); + // Check if already in sync. + let mut missing_parents = HashSet::new(); + for tip in considered_tips.iter() { + assert!(tip != &NULL_ID); - if !dag.contains_key(tip.as_bytes()).unwrap() { - missing_parents.insert(*tip); - } + if !dag.contains_key(tip.as_bytes()).unwrap() { + missing_parents.insert(*tip); } + } - if missing_parents.is_empty() { - *self.synced.write().await = true; - info!(target: "event_graph::dag_sync", "[EVENTGRAPH] DAG synced successfully!"); - return Ok(()) - } + if missing_parents.is_empty() { + *self.synced.write().await = true; + info!(target: "event_graph::dag_sync", "[EVENTGRAPH] DAG synced successfully!"); + return Ok(()) } // Header sync first