filter.GetTheoreticalLimit() to encompass the actual limit specified in the filter.

This commit is contained in:
fiatjaf
2025-12-19 06:52:46 -03:00
parent 14dcc01f8f
commit daee8575d9
7 changed files with 23 additions and 20 deletions

View File

@@ -96,14 +96,11 @@ func (il *IndexingLayer) QueryEvents(filter nostr.Filter, maxLimit int) iter.Seq
}
// max number of events we'll return
if tlimit := filter.GetTheoreticalLimit(); tlimit == 0 || filter.LimitZero {
if tlimit := filter.GetTheoreticalLimit(); tlimit == 0 {
return
} else if tlimit < maxLimit {
maxLimit = tlimit
}
if filter.Limit > 0 && filter.Limit < maxLimit {
maxLimit = filter.Limit
}
il.lmdbEnv.View(func(txn *lmdb.Txn) error {
txn.RawRead = true