forked from Kieran/snort
Use default relays and explicit relays
This commit is contained in:
parent
0c2f669017
commit
1e5b573045
@ -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);
|
||||||
|
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user