diff --git a/src/datastore.rs b/src/datastore.rs index b94bc92..9720577 100644 --- a/src/datastore.rs +++ b/src/datastore.rs @@ -190,16 +190,11 @@ impl Store { /// returns old pubkey if node got updated async fn update_node(&self, ip: String, info: NodeInfo) -> Option { - // if let Some(old_node) = self.nodes.get(&ip) { - // if SystemTime::now() - // .duration_since(old_node.updated_at) - // .unwrap_or(Duration::ZERO) - // .as_secs() - // < 50 - // { - // return None; - // } - // } + if let Some(old_node) = self.nodes.get(&ip) { + if old_node.updated_at > info.updated_at { + return None; + } + } self.nodes.insert(ip, info.clone()) }