throw error when block cannot be found
This commit is contained in:
parent
7620f16c54
commit
3c17582bd5
|
@ -28,6 +28,10 @@ ChainManager.prototype.loadConfig = function(config) {
|
|||
ChainManager.prototype.init = function(env, config) {
|
||||
web3.setProvider(new web3.providers.HttpProvider("http://" + config.rpcHost + ":" + config.rpcPort));
|
||||
|
||||
var block = web3.eth.getBlock(0);
|
||||
if(!block){
|
||||
throw new Error("Cannot get the genesis block, is embark blockchain running ?");
|
||||
}
|
||||
var chainId = web3.eth.getBlock(0).hash;
|
||||
|
||||
if (this.chainManagerConfig[chainId] === undefined) {
|
||||
|
|
Loading…
Reference in New Issue