Skip to content

Commit

Permalink
db: update negentropy_items method for MemoryDatabase
Browse files Browse the repository at this point in the history
  • Loading branch information
yukibtc committed Oct 23, 2023
1 parent 56fb935 commit e0ecbb5
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions crates/nostr-sdk-db/src/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,20 +237,9 @@ impl NostrDatabase for MemoryDatabase {

async fn negentropy_items(
&self,
filter: &Filter,
_filter: &Filter,
) -> Result<Vec<(EventId, Timestamp)>, Self::Err> {
if self.opts.events {
let events = self.events.read().await;
let mut items: Vec<(EventId, Timestamp)> = Vec::new();
for event in events.values() {
if filter.match_event(event) {
items.push((event.id, event.created_at));
}
}
Ok(items)
} else {
Err(DatabaseError::FeatureDisabled)
}
Err(DatabaseError::NotSupported)
}

async fn wipe(&self) -> Result<(), Self::Err> {
Expand Down

0 comments on commit e0ecbb5

Please sign in to comment.