damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit 453d5402555be2bb97e54f44cfdb5272e211354a
parent 5ded564bdcbaf107fe2495d34433f594027cc539
Author: William Casarin <jb55@jb55.com>
Date:   Sun,  6 Aug 2023 06:48:49 -0700

search: find_event_with_subid

I needed this to find a bug in event decoding

Diffstat:
Mdamus/ContentView.swift | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/damus/ContentView.swift b/damus/ContentView.swift @@ -784,7 +784,11 @@ enum FoundEvent { } func find_event(state: DamusState, query query_: FindEvent, callback: @escaping (FoundEvent?) -> ()) { - + return find_event_with_subid(state: state, query: query_, subid: UUID().description, callback: callback) +} + +func find_event_with_subid(state: DamusState, query query_: FindEvent, subid: String, callback: @escaping (FoundEvent?) -> ()) { + var filter: NostrFilter? = nil let find_from = query_.find_from let query = query_.type @@ -806,7 +810,6 @@ func find_event(state: DamusState, query query_: FindEvent, callback: @escaping filter = NostrFilter(ids: [evid], limit: 1) } - let subid = UUID().description var attempts: Int = 0 var has_event = false guard let filter else { return }