From f411aa6fc21abeeaf9e175fc62e8411a8a8247c2 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Thu, 22 Dec 2022 13:01:48 -0600 Subject: [PATCH] fix: do not re-verify NIP-05 entries where metadata was deleted --- src/nip05.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nip05.rs b/src/nip05.rs index 2583146..8f73751 100644 --- a/src/nip05.rs +++ b/src/nip05.rs @@ -721,7 +721,7 @@ pub fn query_oldest_user_verification( earliest: u64, ) -> Result { let tx = conn.transaction()?; - let query = "SELECT v.id, v.name, e.event_hash, e.author, e.created_at, v.verified_at, v.failed_at, v.failure_count FROM user_verification v LEFT JOIN event e ON e.id=v.metadata_event WHERE (v.verified_at < ? OR v.verified_at IS NULL) AND (v.failed_at < ? OR v.failed_at IS NULL) ORDER BY v.verified_at ASC, v.failed_at ASC LIMIT 1;"; + let query = "SELECT v.id, v.name, e.event_hash, e.author, e.created_at, v.verified_at, v.failed_at, v.failure_count FROM user_verification v INNER JOIN event e ON e.id=v.metadata_event WHERE (v.verified_at < ? OR v.verified_at IS NULL) AND (v.failed_at < ? OR v.failed_at IS NULL) ORDER BY v.verified_at ASC, v.failed_at ASC LIMIT 1;"; let mut stmt = tx.prepare_cached(query)?; let fields = stmt.query_row(params![earliest, earliest], |r| { let rowid: u64 = r.get(0)?;