simplify whisper config condition

This commit is contained in:
Iuri Matias 2016-10-30 19:53:23 -04:00
parent 88bdd662de
commit 5c05b7f8d9
1 changed files with 2 additions and 7 deletions

View File

@ -19,15 +19,10 @@ var Blockchain = function(blockchainConfig, Client) {
port: this.blockchainConfig.port || 30303, port: this.blockchainConfig.port || 30303,
nodiscover: this.blockchainConfig.nodiscover || false, nodiscover: this.blockchainConfig.nodiscover || false,
mine: this.blockchainConfig.mine || false, mine: this.blockchainConfig.mine || false,
account: this.blockchainConfig.account || {} account: this.blockchainConfig.account || {},
whisper: (this.blockchainConfig.whisper === undefined) || this.blockchainConfig.whisper
}; };
if (this.blockchainConfig.whisper === false) {
this.config.whisper = false;
} else {
this.config.whisper = (this.blockchainConfig.whisper || true);
}
this.client = new Client({config: this.config}); this.client = new Client({config: this.config});
}; };