diff --git a/lib/modules/blockchain_process/blockchain.js b/lib/modules/blockchain_process/blockchain.js index 90e4a1619..f5c3f85d5 100644 --- a/lib/modules/blockchain_process/blockchain.js +++ b/lib/modules/blockchain_process/blockchain.js @@ -231,7 +231,7 @@ Blockchain.prototype.readyCallback = function() { if (this.config.mineWhenNeeded && !this.isDev) { const GethMiner = require('./miner'); - this.miner = new GethMiner(); + this.miner = new GethMiner({datadir: this.blockchainConfig.datadir}); } }; @@ -316,7 +316,7 @@ Blockchain.prototype.initChainAndGetAddress = function(callback) { }; var BlockchainClient = function(blockchainConfig, client, env, onReadyCallback, onExitCallback) { - const isDev = blockchainConfig.isDev || blockchainConfig.default; + const isDev = Boolean(blockchainConfig.isDev); // TODO add other clients at some point if (client === 'geth') { return new Blockchain({blockchainConfig, client: GethCommands, env, isDev, onReadyCallback, onExitCallback}); diff --git a/lib/modules/blockchain_process/miner.js b/lib/modules/blockchain_process/miner.js index 16590a10d..79f132b83 100644 --- a/lib/modules/blockchain_process/miner.js +++ b/lib/modules/blockchain_process/miner.js @@ -13,11 +13,12 @@ const getChanges = 'eth_getFilterChanges'; const getBlockCount = 'eth_getBlockTransactionCountByNumber'; class GethMiner { - constructor() { + constructor(options) { const self = this; // TODO: Find a way to load mining config from YML. // In the meantime, just set an empty config object this.config = {}; + this.datadir = options.datadir; self.interval = null; self.callback = null; self.started = null;