Browse Source

added min notaries initial query limit

all-modes
pbca26 8 years ago
parent
commit
ed464cd999
  1. 49
      gui/init.js
  2. 19
      gui/loading.js
  3. 2
      main.js
  4. 1
      routes/shepherd.js

49
gui/init.js

@ -15,32 +15,27 @@ $(document).ready(function() {
StartIguana();
}
if (appConf && !appConf.skipBasiliskNetworkCheck) {
var portcheck;
function sartcheck() {
portcheck = setInterval(function(){
Iguana_activehandle().then(function(result){
console.log(result);
if (result !== 'error') {
stopcheck();
$('#loading_status_text').text('Connecting to Basilisk Network...');
EDEX_DEXgetinfoAll();
}
})
//var check = Iguana_activehandle();
//console.log(check[0])
}, 2000);
}
function stopcheck() {
clearInterval(portcheck);
}
sartcheck();
//setTimeout(function(){ window.close(); }, 15000);
} else {
window.hide();
var portcheck;
function sartcheck() {
portcheck = setInterval(function(){
Iguana_activehandle().then(function(result){
console.log(result);
if (result !== 'error') {
stopcheck();
$('#loading_status_text').text('Connecting to Basilisk Network...');
EDEX_DEXgetinfoAll(appConf.skipBasiliskNetworkCheck, appConf.minNotaries);
}
})
//var check = Iguana_activehandle();
//console.log(check[0])
}, 2000);
}
function stopcheck() {
clearInterval(portcheck);
}
sartcheck();
});

19
gui/loading.js

@ -108,7 +108,11 @@ function EDEX_DEXnotarychains() {
});
}
function EDEX_DEXgetinfoAll() {
function EDEX_DEXgetinfoAll(skip, minNotaries) {
const remote = require('electron').remote;
var window = remote.getCurrentWindow();
if (!skip) {
var tmpIguanaRPCAuth = 'tmpIgRPCUser@' + sessionStorage.getItem('IguanaRPCAuth'),
ajax_data = {
'userpass': tmpIguanaRPCAuth,
@ -117,9 +121,8 @@ function EDEX_DEXgetinfoAll() {
},
tmp_index = 0,
get_dex_notarychains = IguanaAJAX('http://127.0.0.1:7778', ajax_data).done(function(data) {
//console.log(get_dex_notarychains.responseText);
get_dex_notarychains = JSON.parse(get_dex_notarychains.responseText);
//console.log(get_dex_notarychains)
get_dex_notarychains = get_dex_notarychains.splice(0, minNotaries);
$.each(get_dex_notarychains, function( coin_index, coin_value ) {
console.log(coin_index + ': ' + coin_value);
@ -129,8 +132,7 @@ function EDEX_DEXgetinfoAll() {
'agent': 'dex',
'method': 'getinfo',
'symbol': coin_value
},
basiliskMinNotariesConnected = 10;
};
console.log(ajax_data);
@ -148,10 +150,8 @@ function EDEX_DEXgetinfoAll() {
$('#loading_sub_status_output_text').text('Output: Connected');
}
if ( tmp_index == 10 ) {
if ( tmp_index == minNotaries ) {
console.log('min notaries connected');
const remote = require('electron').remote;
var window = remote.getCurrentWindow();
window.hide();
}
}).fail(function(xhr, textStatus, error) {
@ -165,4 +165,7 @@ function EDEX_DEXgetinfoAll() {
}
});
});
} else {
window.hide();
}
}

2
main.js

@ -63,7 +63,7 @@ guiapp.use('/shepherd', shepherd);
var rungui = guiapp.listen(appConfig.iguanaAppPort, function () {
console.log('guiapp listening on port ' + appConfig.iguanaAppPort + '!');
})
});
module.exports = guiapp;
// END GUI App Settings

1
routes/shepherd.js

@ -62,6 +62,7 @@ shepherd.appConfig = {
"iguanaGuiOnly": false,
"manualIguanaStart": false,
"skipBasiliskNetworkCheck": false,
"minNotaries": 50,
"host": "127.0.0.1",
"iguanaAppPort": 17777,
"iguanaCorePort": 7778,

Loading…
Cancel
Save