diff --git a/package.json b/package.json index 79ba6ab..327c6ba 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,20 @@ { - "name": "agama_app", + "name": "iguana_app", "productName": "Agama", "version": "0.1.5", - "description": "Agama Desktop App", + "description": "iguana Desktop App", "main": "main.js", "scripts": { "start": "electron ." }, - "repository": "https://github.com/SuperNETorg/Agama/", + "repository": "https://github.com/SuperNETorg/iguana/", "keywords": [ "iguana", "superNET", "komodo", "easydex", "instantdex", - "pax", - "agama" + "pax" ], "author": "ca333, grewalsatinder", "license": "MIT", diff --git a/routes/cache.js b/routes/cache.js index 0453f5a..c1b7b41 100644 --- a/routes/cache.js +++ b/routes/cache.js @@ -233,8 +233,6 @@ cache.one = function(req, res, next) { total =+ callStack[coin]; } - delete callStack.all; - if (total / Object.keys(callStack).length === 1) { cacheCallInProgress = false; cache.io.emit('messages', { @@ -468,7 +466,7 @@ cache.one = function(req, res, next) { console.log(JSON.parse(body).result); writeCache(); var addrCount = outObj.basilisk[coin].addresses ? outObj.basilisk[coin].addresses.length : 0; - var callsArrayBTC = callsArray.length; // restrict BTC and SYS only to listunspent and listtransactions calls + var callsArrayBTC = callsArray.length; if (callsArray.indexOf('getbalance') > - 1) { callsArrayBTC--; } @@ -478,19 +476,11 @@ cache.one = function(req, res, next) { callStack[coin] = callStack[coin] + addrCount * (coin === 'BTC' || coin === 'SYS' ? callsArrayBTC : callsArray.length); console.log(coin + ' stack len ' + callStack[coin]); - if (body.indexOf('need to unlock wallet') > -1) { - callStack[coin] = 1; - checkCallStack(); - console.log('error wallet is locked'); - } else { - async.each(outObj.basilisk[coin].addresses, function(address) { - execDEXRequests(address, coin); - }); - } + async.each(outObj.basilisk[coin].addresses, function(address) { + execDEXRequests(address, coin); + }); } else { - callStack[coin] = 1; - checkCallStack(); - console.log('error getting ' + coin + ' addrs'); + // TODO: error } }); } @@ -513,7 +503,6 @@ cache.one = function(req, res, next) { if (coin === 'all') { var tempUrl = 'http://' + cache.appConfig.host + ':' + cache.appConfig.iguanaCorePort + '/api/InstantDEX/allcoins?userpass=' + sessionKey; - console.log(tempUrl); request({ url: mock ? 'http://localhost:17777/shepherd/mock?url=' + tempUrl : tempUrl, method: 'GET' @@ -561,16 +550,11 @@ cache.one = function(req, res, next) { getAddresses(coin); }); - } else { - console.log('no coin is running in basilisk'); - callStack[coin] = 1; - checkCallStack(); } } if (error) { // stop further requests on failure, exit callStack[coin] = 1; checkCallStack(); - console.log('error getting allcoins'); } }); } else { diff --git a/routes/mock.js b/routes/mock.js index fd3fcd6..39e4156 100644 --- a/routes/mock.js +++ b/routes/mock.js @@ -12,7 +12,7 @@ mock.setVar = function(variable, value) { mock.get = function(req, res, next) { var _url = req.query.url; - if (_url.indexOf('/api/InstantDEX/allcoins') > -1) { + if (_url.indexOf('/InstantDEX/allcoins') > -1) { res.end(JSON.stringify({ 'native': [], 'basilisk': [ 'KMD', 'BTC'], @@ -28,8 +28,8 @@ mock.get = function(req, res, next) { } if (_url.indexOf('/api/dex/listunspent') > -1 || _url.indexOf('/api/dex/listtransactions') > -1 || - _url.indexOf('/api/dex/getbalance') > -1 || - _url.indexOf('/api/basilisk/refresh') > -1) { + _url.indexOf('/api/ss/getbalance') > -1 || + _url.indexOf('/api/ww/refresh') > -1) { res.end(JSON.stringify({ 'some key': 'some value' }));