improved stability

This commit is contained in:
ghe0 2024-08-22 02:14:35 +03:00
parent 8ef7757267
commit 3e323cbd23
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -190,16 +190,11 @@ impl Store {
/// returns old pubkey if node got updated
async fn update_node(&self, ip: String, info: NodeInfo) -> Option<NodeInfo> {
// 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())
}