Skip to content

Commit

Permalink
Fix pending: OutOfSync to supercede NotPublishedRecently.
Browse files Browse the repository at this point in the history
Fixes #714
  • Loading branch information
mikedilger committed Apr 16, 2024
1 parent b8938d1 commit 015d80d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions gossip-lib/src/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,15 +263,6 @@ impl Pending {
self.remove(&PendingItem::PersonListNeverPublished(*list));
}

// If 90 days old, should be re-synced
if metadata.event_created_at.0 + t90days < now.0 {
self.insert(PendingItem::PersonListNotPublishedRecently(*list));
continue;
} else {
self.remove(&PendingItem::PersonListNotPublishedRecently(*list));
// remove if present
}

// If mismatched, should be re-synced
let stored_hash = GLOBALS.storage.hash_person_list(*list)?;
let last_event_hash = crate::people::hash_person_list_event(*list)?;
Expand All @@ -281,6 +272,15 @@ impl Pending {
} else {
self.remove(&PendingItem::PersonListOutOfSync(*list)); // remove if present
}

// If 90 days old, should be re-synced
if metadata.event_created_at.0 + t90days < now.0 {
self.insert(PendingItem::PersonListNotPublishedRecently(*list));
continue;
} else {
self.remove(&PendingItem::PersonListNotPublishedRecently(*list));
// remove if present
}
}

{
Expand Down

0 comments on commit 015d80d

Please sign in to comment.