From e9d2a2cbd0cb244e968cace705601fb919dde627 Mon Sep 17 00:00:00 2001 From: Greg Heartsfield Date: Wed, 4 Jan 2023 16:51:22 -0600 Subject: [PATCH] perf(NIP-26): temporarily disable NIP-26 delegated events --- src/db.rs | 29 ++--------------------------- src/info.rs | 2 +- 2 files changed, 3 insertions(+), 28 deletions(-) diff --git a/src/db.rs b/src/db.rs index bed22b1..291a4a7 100644 --- a/src/db.rs +++ b/src/db.rs @@ -548,34 +548,9 @@ fn query_from_filter(f: &ReqFilter) -> (String, Vec>) { } } } - // take each author and convert to a hexsearch - let mut del_searches: Vec = vec![]; - for auth in authvec { - match hex_range(auth) { - Some(HexSearch::Exact(ex)) => { - del_searches.push("delegated_by=?".to_owned()); - params.push(Box::new(ex)); - } - Some(HexSearch::Range(lower, upper)) => { - del_searches.push( - "(delegated_by>? AND delegated_by { - del_searches.push("delegated_by>?".to_owned()); - params.push(Box::new(lower)); - } - None => { - info!("Could not parse hex range from author {:?}", auth); - } - } - } if !authvec.is_empty() { - // combine auth_searches and del_searches - let comb_clause = format!("({} OR {})", auth_searches.join(" OR "), del_searches.join(" OR ")); - filter_components.push(comb_clause); + let auth_clause = format!("({})", auth_searches.join(" OR ")); + filter_components.push(auth_clause); } else { filter_components.push("false".to_owned()); } diff --git a/src/info.rs b/src/info.rs index 7b66267..e0b12f9 100644 --- a/src/info.rs +++ b/src/info.rs @@ -35,7 +35,7 @@ impl From for RelayInfo { description: i.description, pubkey: i.pubkey, contact: i.contact, - supported_nips: Some(vec![1, 2, 9, 11, 12, 15, 16, 20, 22, 26]), + supported_nips: Some(vec![1, 2, 9, 11, 12, 15, 16, 20, 22]), software: Some("https://git.sr.ht/~gheartsfield/nostr-rs-relay".to_owned()), version: CARGO_PKG_VERSION.map(|x| x.to_owned()), }