diff --git a/CHANGELOG.md b/CHANGELOG.md index b2e09ac82..835d93272 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## [4.2.34] - 2024.6.18 + +### Updated + +- Disable auto-discovery of RPC nodes when there is only one node. + ## [4.2.33] - 2024.6.17 ### Added diff --git a/package.json b/package.json index bde547fb6..3104e0c73 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tatumio/tatum", - "version": "4.2.33", + "version": "4.2.34", "description": "Tatum JS SDK", "author": "Tatum", "repository": "https://github.com/tatumio/tatum-js", diff --git a/src/service/rpc/generic/LoadBalancer.ts b/src/service/rpc/generic/LoadBalancer.ts index 24e460755..f1937fa31 100644 --- a/src/service/rpc/generic/LoadBalancer.ts +++ b/src/service/rpc/generic/LoadBalancer.ts @@ -104,11 +104,13 @@ export class LoadBalancer implements AbstractRpcInterface { process.on('exit', () => this.destroy()) } - if (config.rpc?.oneTimeLoadBalancing) { - Utils.log({ id: this.id, message: 'oneTimeLoadBalancing enabled' }) - await this.checkStatuses() - } else { - this.interval = setInterval(() => this.checkStatuses(), Constant.OPEN_RPC.LB_INTERVAL) + if (nodes && nodes.length > 1) { + if (config.rpc?.oneTimeLoadBalancing) { + Utils.log({ id: this.id, message: 'oneTimeLoadBalancing enabled' }) + await this.checkStatuses() + } else { + this.interval = setInterval(() => this.checkStatuses(), Constant.OPEN_RPC.LB_INTERVAL) + } } }