From 09a5ea8ba165a071b4439ae675563856616ceb01 Mon Sep 17 00:00:00 2001 From: "Michael Bradley, Jr" Date: Mon, 29 Oct 2018 14:45:26 +0100 Subject: [PATCH] test if client version is supported, warn if not or can't determine --- lib/modules/blockchain_process/blockchain.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index b1723cf3a..419b8a44b 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -305,6 +305,13 @@ Blockchain.prototype.isClientInstalled = function (callback) { if (err || !stdout || stderr.indexOf("not found") >= 0 || stdout.indexOf("not found") >= 0) { return callback(__('Ethereum client bin not found:') + ' ' + this.client.getBinaryPath()); } + const parsedVersion = this.client.parseVersion(stdout); + const supported = this.client.isSupportedVersion(parsedVersion); + if (supported === undefined) { + this.logger.error((__('WARNING! Ethereum client version could not be determined or compared with version range') + ' ' + this.client.versSupported + __(', for best results please use a supported version')).yellow); + } else if (!supported) { + this.logger.error((__('WARNING! Ethereum client version unsupported, for best results please use a version in range') + ' ' + this.client.versSupported).yellow); + } callback(); }); };