fix query behaviour when limit is present (reported by @Mazin)

This commit is contained in:
Doug Hoyte
2023-02-21 16:42:45 -05:00
parent e5e5ff6817
commit 5175664e2f
11 changed files with 417 additions and 447 deletions

View File

@ -3,7 +3,7 @@
#include <docopt.h>
#include "golpe.h"
#include "DBScan.h"
#include "DBQuery.h"
#include "events.h"
#include "gc.h"
@ -43,10 +43,7 @@ void cmd_delete(const std::vector<std::string> &subArgs) {
}
auto filterGroup = NostrFilterGroup::unwrapped(filter, MAX_U64);
Subscription sub(1, "junkSub", filterGroup);
DBScanQuery query(sub);
DBQuery query(filter);
btree_set<uint64_t> levIds;
@ -54,7 +51,7 @@ void cmd_delete(const std::vector<std::string> &subArgs) {
auto txn = env.txn_ro();
while (1) {
bool complete = query.process(txn, MAX_U64, false, [&](const auto &sub, uint64_t levId){
bool complete = query.process(txn, [&](const auto &sub, uint64_t levId){
levIds.insert(levId);
});