Skip to content

Commit

Permalink
chore: add check to modified time
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Dec 23, 2024
1 parent adfe6ad commit 8a64bef
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extensions/warp-ipfs/src/hotspot/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down

0 comments on commit 8a64bef

Please sign in to comment.