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

Merge branch 'docker' of ssh://gitlab.bfa.ar/blockchain/nucleo into docker

parents 2ff9e175 88b4eb05
No related branches found
No related tags found
No related merge requests found
......@@ -96,11 +96,16 @@ module.exports = class Libbfa
body: body,
callback: function RPCresponse( err, obj )
{
var r;
var e;
if ( err )
throw new Error( err );
e = err;
else
if ( obj.body.error && obj.body.error.code && obj.body.error.message )
throw new Error( 'Error ' + obj.body.error.code + ": "+ obj.body.error.message );
callback(obj.body.result);
e = 'Error ' + obj.body.error.code + ": "+ obj.body.error.message;
else
r = obj.body.result;
callback(e, r);
}
});
};
......
......@@ -120,13 +120,15 @@ function parsenode( node )
return n;
}
function gotAdminPeers( nodelist )
function gotAdminPeers( err, nodelist )
{
var nowpeers = [];
var peerscache = readPeersCache();
var newoutpeers = [];
var currentnodes = [];
if ( err )
return;
// The nodelist also contains peers which are not yet validated
// if they even belong to this network. Parsenode returns an
// object or nothing, based on our criteria
......@@ -208,8 +210,9 @@ function mayseal()
// Get a list of clique.getSigners, so we can see if we are
// in the list of authorized sealers.
web3.bfa.clique.getSigners(
function gotListOfSealers(x)
function gotListOfSealers(e,x)
{
if (e) return;
var lcsealers = x.map( name => name.toLowerCase() );
var isSigner = (lcsealers.indexOf(me) > -1);
if ( isSigner )
......@@ -245,8 +248,9 @@ function unlock()
return;
var unlockedsomething = false;
web3.bfa.personal.listWallets(
function pushone(x)
function pushone(e,x)
{
if (e) return;
var i = x.length;
var wallets = new Array();
while ( i-- > 0 )
......@@ -302,7 +306,16 @@ function unlock()
function timer()
{
if ( netid == 0 )
web3.eth.net.getId().then( x => {netid = x} );
{
web3.eth.net.getId()
.then( x => {
netid = x;
} )
.catch( err => {
console.log("monitor.js non-fatal: "+err)
});
return;
}
peerlist();
mayseal();
unlock();
......
......@@ -2,6 +2,9 @@
# 20190816 Robert Martin-Legene
# GPL2-only
# BFA tiene 3 bootnodes oficiales.
# Para levantar un bootnode hay que poner la clave en
# este archivo. Se genera la clave con: bootnode -genkey
bootnodekeyfile=${BFANETWORKDIR}/bootnode/key
# Bail out if anything fails.
......
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