Browse Source

event_graph: set synced boolean to true after all dags are synced

oars 10 months ago
parent
commit
454a25fd96
1 changed files with 2 additions and 4 deletions
  1. 2 4
      src/event_graph/mod.rs

+ 2 - 4
src/event_graph/mod.rs

@@ -595,8 +595,7 @@ impl EventGraph {
         }
 
         if missing_parents.is_empty() {
-            *self.synced.write().await = true;
-            info!(target: "event_graph::dag_sync", "[EVENTGRAPH] DAG synced successfully!");
+            info!(target: "event_graph::dag_sync()", "[EVENTGRAPH] DAG synced successfully!");
             return Ok(())
         }
 
@@ -714,8 +713,6 @@ impl EventGraph {
         }
         // <-- end download payload
 
-        *self.synced.write().await = true;
-
         info!(target: "event_graph::dag_sync()", "[EVENTGRAPH] DAG synced successfully!");
         Ok(())
     }
@@ -734,6 +731,7 @@ impl EventGraph {
             }
         }
 
+        *self.synced.write().await = true;
         Ok(())
     }