tolerate lack of blockchain config file

This commit is contained in:
Iuri Matias 2017-12-16 08:48:37 -05:00
parent 747237de76
commit a76dbb69b9
1 changed files with 4 additions and 1 deletions

View File

@ -64,7 +64,10 @@ Config.prototype.reloadConfig = function() {
};
Config.prototype.loadBlockchainConfigFile = function() {
var defaultBlockchainConfig = fs.readJSONSync(this.configDir + "blockchain.json");
var defaultBlockchainConfig = {};
if (fs.existsSync(this.configDir + "blockchain.json")) {
defaultBlockchainConfig = fs.readJSONSync(this.configDir + "blockchain.json");
}
this.blockchainConfig = defaultBlockchainConfig[this.env] || {};
if (this.blockchainConfig.enabled === undefined) {