diff --git a/CHANGELOG.md b/CHANGELOG.md index c32aa7fcd..bb9d8d0ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,11 @@ -## [4.2.34] - 2024.6.178 +## [4.2.35] - 2024.6.18 + +### Updated + +- Disable auto-discovery of RPC nodes when there is only one node. + +## [4.2.34] - 2024.6.18 + ### Added - Support for Casper mainnet diff --git a/package.json b/package.json index 3104e0c73..f4ae6629c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tatumio/tatum", - "version": "4.2.34", + "version": "4.2.35", "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) + } } }