mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-17 21:32:55 +01:00
lmdbn/badgern: fix for tag array crashes on query planner.
This commit is contained in:
parent
8968982b9a
commit
24d1e3aebd
@ -248,7 +248,14 @@ func prepareQueries(filter nostr.Filter) (
|
||||
extraFilter = &nostr.Filter{Tags: filter.Tags}
|
||||
} else if len(filter.Tags) > 0 {
|
||||
index = indexTagPrefix
|
||||
queries = make([]query, len(filter.Tags))
|
||||
|
||||
// determine the size of the queries array by inspecting all tags sizes
|
||||
size := 0
|
||||
for _, values := range filter.Tags {
|
||||
size += len(values)
|
||||
}
|
||||
queries = make([]query, size)
|
||||
|
||||
extraFilter = &nostr.Filter{Kinds: filter.Kinds}
|
||||
i := 0
|
||||
for _, values := range filter.Tags {
|
||||
|
@ -253,7 +253,14 @@ func (b *LMDBBackend) prepareQueries(filter nostr.Filter) (
|
||||
extraFilter = &nostr.Filter{Tags: filter.Tags}
|
||||
} else if len(filter.Tags) > 0 {
|
||||
dbi = b.indexTag
|
||||
queries = make([]query, len(filter.Tags))
|
||||
|
||||
// determine the size of the queries array by inspecting all tags sizes
|
||||
size := 0
|
||||
for _, values := range filter.Tags {
|
||||
size += len(values)
|
||||
}
|
||||
queries = make([]query, size)
|
||||
|
||||
extraFilter = &nostr.Filter{Kinds: filter.Kinds}
|
||||
i := 0
|
||||
for _, values := range filter.Tags {
|
||||
|
Loading…
x
Reference in New Issue
Block a user