badger: make sure we don't match tag index keys that are bigger than the queried tag.

This commit is contained in:
fiatjaf
2023-11-13 16:33:43 -03:00
parent a29b9f298c
commit 2621ff5f91

View File

@@ -54,6 +54,10 @@ func (b BadgerBackend) QueryEvents(ctx context.Context, filter nostr.Filter) (ch
item := it.Item()
key := item.Key()
if len(key)-4 != idxOffset {
continue
}
if !q.skipTimestamp {
createdAt := binary.BigEndian.Uint32(key[prefixLen:idxOffset])
if createdAt < since {