eventstore: fuzz testing found us a bug!

This commit is contained in:
fiatjaf
2025-08-05 22:56:55 -03:00
parent 47ca205e9e
commit 030cad168d
13 changed files with 1203 additions and 118 deletions
+3 -1
View File
@@ -110,7 +110,9 @@ func (b *BoltBackend) query(txn *bbolt.Tx, filter nostr.Filter, limit int, yield
// after pulling from all iterators once we now find out what iterators are
// the ones we should keep pulling from next (i.e. which one's last emitted timestamp is the highest)
threshold := iterators.quickselect(min(numberOfIteratorsToPullOnEachRound, len(iterators)))
k := min(numberOfIteratorsToPullOnEachRound, len(iterators))
iterators.quickselect(k)
threshold := iterators.threshold(k)
// so we can emit all the events higher than the threshold
for i := range iterators {