From 503bde2a895f600f905aae0827a77ece8ddb7efe Mon Sep 17 00:00:00 2001 From: Yuki Kishimoto Date: Fri, 29 Sep 2023 09:43:20 +0200 Subject: [PATCH] sdk: check if event was already seen before verify signature --- crates/nostr-sdk/src/relay/pool.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/nostr-sdk/src/relay/pool.rs b/crates/nostr-sdk/src/relay/pool.rs index 56a6184ec..d27ae3488 100644 --- a/crates/nostr-sdk/src/relay/pool.rs +++ b/crates/nostr-sdk/src/relay/pool.rs @@ -161,10 +161,10 @@ impl RelayPoolTask { match msg { RelayMessage::Event { event, .. } => { - // Verifies if the event is valid - if event.verify().is_ok() { - // Adds only new events - if this.add_event(event.id).await { + // Check if event was already seen + if this.add_event(event.id).await { + // Verifies if the event is valid + if event.verify().is_ok() { let notification = RelayPoolNotification::Event( relay_url, event.as_ref().clone(),