Browse Source

fixed cache override bug

all-modes
pbca26 8 years ago
parent
commit
5a0ac322da
  1. 7
      routes/shepherd.js

7
routes/shepherd.js

@ -294,10 +294,12 @@ shepherd.get('/cache-one', function(req, res, next) {
outObj = JSON.parse(fs.readFileSync(iguanaDir + '/cache-' + pubkey + '.json', 'utf8')); outObj = JSON.parse(fs.readFileSync(iguanaDir + '/cache-' + pubkey + '.json', 'utf8'));
if (!outObj || !outObj.basilisk) { if (!outObj || !outObj.basilisk) {
console.log('no local basilisk info');
outObj['basilisk'] = {}; outObj['basilisk'] = {};
outObj['basilisk'][coin] = {}; outObj['basilisk'][coin] = {};
} else { } else {
if (!outObj[coin]) { if (!outObj['basilisk'][coin]) {
console.log('no local coin info');
outObj['basilisk'][coin] = {}; outObj['basilisk'][coin] = {};
} }
} }
@ -333,8 +335,11 @@ shepherd.get('/cache-one', function(req, res, next) {
} }
//console.log(JSON.stringify(dexUrls)); //console.log(JSON.stringify(dexUrls));
console.log(coin + ' address ' + address); console.log(coin + ' address ' + address);
if (!outObj.basilisk[coin][address]) {
outObj.basilisk[coin][address] = {}; outObj.basilisk[coin][address] = {};
writeCache(); writeCache();
}
writeCache();
async.forEachOf(_dexUrls, function(dexUrl, key) { async.forEachOf(_dexUrls, function(dexUrl, key) {
request({ request({

Loading…
Cancel
Save