Skip to content
Snippets Groups Projects
Commit e94b2b3c authored by Robert Martin-Legene's avatar Robert Martin-Legene
Browse files

Parches chicos

parent 5a098d5c
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment