Use default relays and explicit relays

This commit is contained in:
Kieran 2023-06-19 10:38:17 +01:00
parent 0c2f669017
commit 1e5b573045
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941
2 changed files with 5 additions and 2 deletions

View File

@ -225,8 +225,9 @@ export class NostrSystem extends ExternalStore<SystemSnapshot> implements System
} }
} else { } else {
const ret = []; const ret = [];
for (const [, s] of this.#sockets) { for (const [a, s] of this.#sockets) {
if (!s.Ephemeral) { if (!s.Ephemeral) {
this.#log("Sending query to %s %O", a, qSend);
const qt = q.sendToRelay(s, qSend); const qt = q.sendToRelay(s, qSend);
if (qt) { if (qt) {
ret.push(qt); ret.push(qt);

View File

@ -222,7 +222,9 @@ export class RequestFilterBuilder {
build(relays: RelayCache, id: string): Array<BuiltRawReqFilter> { build(relays: RelayCache, id: string): Array<BuiltRawReqFilter> {
// use the explicit relay list first // use the explicit relay list first
if (this.#relays.size > 0) { if (this.#relays.size > 0) {
return [...this.#relays].map(r => { // always query our default relay lists too when using explicit relays
// these explicit relays may not always be available
return [...this.#relays, ""].map(r => {
return { return {
filters: [this.#filter], filters: [this.#filter],
relay: r, relay: r,