earlier `.add()` on pool `_knownIds`.

This commit is contained in:
fiatjaf 2023-03-26 07:10:41 -03:00
parent 6d116a2f7f
commit 687f387385
No known key found for this signature in database
GPG Key ID: BAD43C4BE5C1A3A1
1 changed files with 1 additions and 1 deletions

View File

@ -55,6 +55,7 @@ export class SimplePool {
let set = this._seenOn[id] || new Set()
set.add(url)
this._seenOn[id] = set
_knownIds.add(id)
return _knownIds.has(id)
}
@ -80,7 +81,6 @@ export class SimplePool {
if (!r) return
let s = r.sub(filters, modifiedOpts)
s.on('event', (event: Event) => {
_knownIds.add(event.id as string)
for (let cb of eventListeners.values()) cb(event)
})
s.on('eose', () => {