From 8a64bef399f69c6561d579ffcb480c4a690bc7b0 Mon Sep 17 00:00:00 2001 From: Darius Date: Mon, 23 Dec 2024 18:29:48 -0500 Subject: [PATCH] chore: add check to modified time --- extensions/warp-ipfs/src/hotspot/mod.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/warp-ipfs/src/hotspot/mod.rs b/extensions/warp-ipfs/src/hotspot/mod.rs index fa1f1dc29..147eb795e 100644 --- a/extensions/warp-ipfs/src/hotspot/mod.rs +++ b/extensions/warp-ipfs/src/hotspot/mod.rs @@ -248,6 +248,10 @@ impl HotspotUser { impl HotspotUser { pub fn update_identity_document(&mut self, identity_document: IdentityDocument) { + if self.identity.modified > identity_document.modified { + tracing::warn!(identity = %self.identity.did, "identity is older than previous entry. Ignoring."); + return; + } self.identity = identity_document; self.last_seen = Utc::now(); self.last_seen_timer = Delay::new(Duration::from_secs(2 * 60));