don-'t call web3.eth.getBlock twice

This commit is contained in:
Frederic Heem 2015-09-25 08:55:35 +01:00
parent 8f96834596
commit 6b7b88d58a
1 changed files with 1 additions and 1 deletions

View File

@ -32,7 +32,7 @@ ChainManager.prototype.init = function(env, config) {
if(!block){ if(!block){
throw new Error("Cannot get the genesis block, is embark blockchain running ?"); throw new Error("Cannot get the genesis block, is embark blockchain running ?");
} }
var chainId = web3.eth.getBlock(0).hash; var chainId = block.hash;
if (this.chainManagerConfig[chainId] === undefined) { if (this.chainManagerConfig[chainId] === undefined) {
this.chainManagerConfig[chainId] = {contracts: {}}; this.chainManagerConfig[chainId] = {contracts: {}};