diff --git a/bin/MasterDistiller.js b/bin/MasterDistiller.js index c7deec68f64b8d9ce450fe7e760356a978c66845..47c53a1ff85a15098fc419e46cc5d87b41bd18ec 100755 --- a/bin/MasterDistiller.js +++ b/bin/MasterDistiller.js @@ -27,8 +27,6 @@ function init() bfa = new Libbfa(); web3 = bfa.newweb3(); Distillery = bfa.contract( web3, 'Distillery' ); - if ( undefined == Distillery ) - fatal('Can not initialise Distillery contact.'); web3.eth.getBalance( Distillery.contractaddress ).then( function receivedOwnBalance(val) { Distillery.contractbalance = val; diff --git a/bin/libbfa.js b/bin/libbfa.js index fd18464ebf1ee856dd57b89675a09c37b73f2708..2146b270a883e80d45416b7f560c2962d4ac6f78 100644 --- a/bin/libbfa.js +++ b/bin/libbfa.js @@ -52,16 +52,16 @@ module.exports = class Libbfa { var contractdir = [ this.networkdir, 'contracts', name ].join('/'); if ( ! this.fs.existsSync( contractdir ) ) - return; + this.fatal( 'The directory containing this contract ("' + contractdir + '") does not exist.' ); var contractaddress = this.fs.realpathSync( contractdir ).replace(/^.*\//, ''); if ( undefined == contractaddress ) - return; + this.fatal( 'Contract address for "' + name + '" not found.' ); var abistr = this.fs.readFileSync( contractdir + '/abi' ).toString(); if ( undefined == abistr ) - return; + this.fatal( 'ABI for contract "' + name + '" not found' ); var abi = JSON.parse( abistr ); if ( undefined == abi ) - return; + this.fatal( 'Failed to convert ABI for contract "' + name + '" into JSON.' ); var c = new w3.eth.Contract( abi, contractaddress ); c.abi = abi; c.contractaddress = contractaddress; diff --git a/bin/monitor.js b/bin/monitor.js index 133727b2e4b5d7e084b42463397aee80f05db7d1..2838293a4437fd92aa98d2c65c7b746eb46762ab 100755 --- a/bin/monitor.js +++ b/bin/monitor.js @@ -47,7 +47,7 @@ function peerlist() if ( 'string' == typeof(node.enode) ) { info = node.enode; - if (peers.indexOf( node.enode ) == -1 ) + if (peers.indexOf( node.enode ) == -1 && dir == "out" ) newpeers.push( node.enode ); } else