PoolStore: don't publish to own relay
This commit is contained in:
parent
4e54589c09
commit
d577c51c74
|
@ -12,6 +12,7 @@ import { normalizeFilters } from '@/filter.ts';
|
|||
import { purifyEvent } from '@/storages/hydrate.ts';
|
||||
import { abortError } from '@/utils/abort.ts';
|
||||
import { getRelays } from '@/utils/outbox.ts';
|
||||
import { Conf } from '@/config.ts';
|
||||
|
||||
interface PoolStoreOpts {
|
||||
pool: InstanceType<typeof RelayPoolWorker>;
|
||||
|
@ -37,7 +38,11 @@ class PoolStore implements NStore {
|
|||
|
||||
async event(event: NostrEvent, opts: NStoreOpts = {}): Promise<void> {
|
||||
if (opts.signal?.aborted) return Promise.reject(abortError());
|
||||
const relays = [...await getRelays(event.pubkey)].slice(0, 4);
|
||||
|
||||
const relaySet = await getRelays(event.pubkey);
|
||||
relaySet.delete(Conf.relay);
|
||||
|
||||
const relays = [...relaySet].slice(0, 4);
|
||||
|
||||
event = purifyEvent(event);
|
||||
this.#debug('EVENT', event, relays);
|
||||
|
|
Loading…
Reference in New Issue