diff --git a/lib/core/config.js b/lib/core/config.js index 5c755f010..b7fb5b00b 100644 --- a/lib/core/config.js +++ b/lib/core/config.js @@ -123,8 +123,14 @@ Config.prototype._updateBlockchainCors = function(){ } let cors = corsParts.join(','); - if(blockchainConfig.rpcCorsDomain === 'auto' && cors.length) blockchainConfig.rpcCorsDomain = cors; - if(blockchainConfig.wsOrigins === 'auto' && cors.length) blockchainConfig.wsOrigins = cors; + if(blockchainConfig.rpcCorsDomain === 'auto'){ + if(cors.length) blockchainConfig.rpcCorsDomain = cors; + else blockchainConfig.rpcCorsDomain = ''; + } + if(blockchainConfig.wsOrigins === 'auto'){ + if(cors.length) blockchainConfig.wsOrigins = cors; + else blockchainConfig.wsOrigins = ''; + } }; Config.prototype._mergeConfig = function(configFilePath, defaultConfig, env, enabledByDefault) { diff --git a/lib/modules/whisper/index.js b/lib/modules/whisper/index.js index 7206d452b..be1743400 100644 --- a/lib/modules/whisper/index.js +++ b/lib/modules/whisper/index.js @@ -13,6 +13,10 @@ class Whisper { this.web3 = new Web3(); this.embark = embark; + if (!this.communicationConfig.enabled) { + return; + } + this.connectToProvider(); this.setServiceCheck(); this.addWhisperToEmbarkJS();