Skip to content

Commit

Permalink
Merge pull request #1099 from MutinyWallet/dedup-mints
Browse files Browse the repository at this point in the history
Dedup fedimint events from relays
  • Loading branch information
benthecarman authored Apr 2, 2024
2 parents e5068d4 + 4a15b56 commit 776a510
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mutiny-core/src/nostr/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1679,6 +1679,10 @@ impl<S: MutinyStorage> NostrManager<S> {
})
.collect();

// remove duplicates by federation id, keep the one with the newest event
mints.sort_by(|a, b| b.created_at.cmp(&a.created_at));
mints.dedup_by(|a, b| a.id == b.id);

// add on contact recommendations to mints
for event in events {
// only process federation recommendations
Expand Down

0 comments on commit 776a510

Please sign in to comment.