1
0
mirror of git://jb55.com/damus synced 2024-09-18 19:23:49 +00:00

search: find_event_with_subid

I needed this to find a bug in event decoding
This commit is contained in:
William Casarin 2023-08-06 06:48:49 -07:00
parent 5ded564bdc
commit 453d540255

View File

@ -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 }