1
0
forked from Kieran/snort

Catch relay connect errors

This commit is contained in:
Kieran 2023-01-06 14:59:59 +00:00
parent af5758e522
commit 274f400c7a
Signed by: Kieran
GPG Key ID: DE71CEB3925BE941

View File

@ -15,12 +15,16 @@ export class NostrSystem {
* @param {string} address * @param {string} address
*/ */
ConnectToRelay(address, options) { ConnectToRelay(address, options) {
if (typeof this.Sockets[address] === "undefined") { try {
let c = new Connection(address, options); if (typeof this.Sockets[address] === "undefined") {
for (let s of Object.values(this.Subscriptions)) { let c = new Connection(address, options);
c.AddSubscription(s); for (let s of Object.values(this.Subscriptions)) {
c.AddSubscription(s);
}
this.Sockets[address] = c;
} }
this.Sockets[address] = c; } catch (e) {
console.error(e);
} }
} }