mirror of https://github.com/embarklabs/embark.git
Merge pull request #581 from embark-framework/bug_fix/whisper-cors
When communication is disabled in config, do not run the module in em…
This commit is contained in:
commit
88132b7b6a
|
@ -119,8 +119,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) {
|
||||
|
|
|
@ -11,6 +11,10 @@ class Whisper {
|
|||
this.web3 = new Web3();
|
||||
this.embark = embark;
|
||||
|
||||
if (!this.communicationConfig.enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.connectToProvider();
|
||||
this.setServiceCheck();
|
||||
this.addWhisperToEmbarkJS();
|
||||
|
|
Loading…
Reference in New Issue