From e94b2b3c2187af551114225b8ff60478f7fdfe38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Martin-Leg=C3=A8ne?= <robert@nic.ar> Date: Tue, 11 Dec 2018 15:12:11 -0300 Subject: [PATCH] Parches chicos --- bin/MasterDistiller.js | 2 -- bin/libbfa.js | 8 ++++---- bin/monitor.js | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/bin/MasterDistiller.js b/bin/MasterDistiller.js index c7deec6..47c53a1 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 fd18464..2146b27 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 133727b..2838293 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 -- GitLab