@samouraiwallet/electrum-client
Advanced tools
Comparing version 1.3.0 to 1.4.0
# Changelog | ||
## 1.4.0 (2023-05-24) | ||
- Updated keepAlive to use interval instead of timeout | ||
- Fixed setTimeout on TlsSocketWrapper | ||
- Updated dependencies | ||
## 1.3.0 (2022-12-08) | ||
@@ -4,0 +9,0 @@ - Updated TLS wrapper |
@@ -10,3 +10,3 @@ import { Client } from './lib/client.js'; | ||
private electrumConfig; | ||
private timeout; | ||
private pingInterval; | ||
versionInfo: [string, string]; | ||
@@ -13,0 +13,0 @@ constructor(port: number, host: string, protocol: Protocol, callbacks?: Callbacks); |
@@ -18,3 +18,3 @@ import { Client } from './lib/client.js'; | ||
this.electrumConfig = null; | ||
this.timeout = null; | ||
this.pingInterval = null; | ||
this.versionInfo = ['', '']; | ||
@@ -78,4 +78,4 @@ } | ||
keepAlive() { | ||
if (this.timeout != null) { | ||
clearTimeout(this.timeout); | ||
if (this.pingInterval != null) { | ||
clearInterval(this.pingInterval); | ||
} | ||
@@ -86,3 +86,3 @@ let pingPeriod = 120000; | ||
} | ||
this.timeout = setTimeout(() => { | ||
this.pingInterval = setInterval(() => { | ||
if (this.timeLastCall !== 0 && Date.now() > this.timeLastCall + pingPeriod) { | ||
@@ -97,4 +97,4 @@ this.server_ping().catch((error) => { | ||
super.close(); | ||
if (this.timeout != null) { | ||
clearTimeout(this.timeout); | ||
if (this.pingInterval != null) { | ||
clearInterval(this.pingInterval); | ||
} | ||
@@ -101,0 +101,0 @@ this.reconnect = this.reconnect = this.onClose = this.keepAlive = () => Promise.resolve(this); |
@@ -16,6 +16,4 @@ import tls from 'node:tls'; | ||
if (this._socket) | ||
this._socket.setTimeout(timeout); | ||
this._socket.setTimeout(timeout, callback); | ||
this._timeout = timeout; | ||
if (callback) | ||
callback(); | ||
return this; | ||
@@ -22,0 +20,0 @@ } |
{ | ||
"name": "@samouraiwallet/electrum-client", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"engines": { | ||
@@ -38,12 +38,12 @@ "node": ">=14.0.0" | ||
"devDependencies": { | ||
"@types/node": "^16.18.6", | ||
"@typescript-eslint/eslint-plugin": "^5.46.0", | ||
"@typescript-eslint/parser": "^5.46.0", | ||
"@vitest/coverage-c8": "^0.25.6", | ||
"eslint": "^8.29.0", | ||
"eslint-plugin-import": "^2.25.4", | ||
"eslint-plugin-unicorn": "^45.0.1", | ||
"typescript": "^4.9.4", | ||
"vitest": "^0.25.6" | ||
"@types/node": "^16.18.32", | ||
"@typescript-eslint/eslint-plugin": "^5.59.7", | ||
"@typescript-eslint/parser": "^5.59.7", | ||
"@vitest/coverage-c8": "^0.31.1", | ||
"eslint": "^8.41.0", | ||
"eslint-plugin-import": "^2.27.5", | ||
"eslint-plugin-unicorn": "^47.0.0", | ||
"typescript": "^5.0.4", | ||
"vitest": "^0.31.1" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37912
714