close socket from failed connect.

fixes https://github.com/nbd-wtf/nostr-tools/issues/550
This commit is contained in:
fiatjaf
2026-09-04 01:20:52 -03:00
parent a8fc3499e4
commit e1a62b911f
3 changed files with 4 additions and 2 deletions
+2
View File
@@ -180,6 +180,7 @@ export class AbstractRelay {
if (this.reconnectAttempts === 0) {
this.skipReconnection = true
}
this.ws?.close?.()
this.handleHardClose('relay connection timed out')
}, opts.timeout)
}
@@ -236,6 +237,7 @@ export class AbstractRelay {
if (this.reconnectAttempts === 0) {
this.skipReconnection = true
}
this.ws?.close?.()
this.handleHardClose('relay connection failed')
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@nostr/tools",
"version": "2.25.1",
"version": "2.25.2",
"exports": {
".": "./index.ts",
"./core": "./core.ts",
+1 -1
View File
@@ -1,7 +1,7 @@
{
"type": "module",
"name": "nostr-tools",
"version": "2.25.1",
"version": "2.25.2",
"description": "Tools for making a Nostr client.",
"repository": {
"type": "git",