Browse Source

event_graph: disallow returning duplicate events when getting the successors

dasman 1 year ago
parent
commit
dc406924e1
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/event_graph/event.rs
  2. 1 1
      src/event_graph/mod.rs

+ 1 - 1
src/event_graph/event.rs

@@ -29,7 +29,7 @@ use super::{
 };
 
 /// Representation of an event in the Event Graph
-#[derive(Debug, Clone, SerialEncodable, SerialDecodable)]
+#[derive(Debug, Clone, PartialEq, SerialEncodable, SerialDecodable)]
 pub struct Event {
     /// Timestamp of the event in whole seconds
     pub timestamp: u64,

+ 1 - 1
src/event_graph/mod.rs

@@ -864,7 +864,7 @@ impl EventGraph {
                 continue;
             }
             for (_, ev) in graph.iter() {
-                if ev.layer > tip.0 {
+                if ev.layer > tip.0 && !result.contains(ev) {
                     result.push(ev.clone())
                 }
             }