Fixing sort to only be if not false

Fixes #23
master
Alexander Blair 7 years ago
parent 4fdb237462
commit 0497b37eab

@ -355,8 +355,13 @@ app.get('/miner/:address/chart/hashrate', function (req, res) {
app.get('/miner/:address/chart/hashrate/allWorkers', function (req, res) {
let address = req.params.address;
let identifiers = global.database.getCache(address + '_identifiers').sort();
let identifiers = global.database.getCache(address + '_identifiers');
let returnData = {global: global.database.getCache(req.params.address)['hashHistory']};
if (identifiers !== false){
identifiers.sort();
} else {
return res.json(returnData);
}
let intCounter = 0;
identifiers.forEach(function(identifier){
returnData[identifier] = global.database.getCache(req.params.address+"_"+identifier)['hashHistory'];

Loading…
Cancel
Save