Skip to content

Commit

Permalink
masternodes: fixes for new output format
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Baker <tyler@opensourcefoundries.com>
  • Loading branch information
EmbeddedAndroid committed May 9, 2018
1 parent 17bc2c5 commit 5c97a82
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
9 changes: 1 addition & 8 deletions lib/explorer.js
Expand Up @@ -95,13 +95,6 @@ module.exports = {
});
},

get_masternodecountonline: function(cb) {
var uri = base_url + 'getmasternodecountonline';
request({uri: uri, json: true}, function (error, response, body) {
return cb(body);
});
},

get_blockcount: function(cb) {
var uri = base_url + 'getblockcount';
request({uri: uri, json: true}, function (error, response, body) {
Expand Down Expand Up @@ -407,4 +400,4 @@ module.exports = {
return cb(arr_vin);
});
}
};
};
6 changes: 2 additions & 4 deletions routes/index.js
Expand Up @@ -297,26 +297,24 @@ router.get('/ext/summary', function(req, res) {
lib.get_hashrate(function(hashrate) {
lib.get_connectioncount(function(connections){
lib.get_masternodecount(function(masternodestotal){
lib.get_masternodecountonline(function(masternodesonline){
lib.get_blockcount(function(blockcount) {
db.get_stats(settings.coin, function (stats) {
if (hashrate == 'There was an error. Check your console.') {
hashrate = 0;
}
var masternodesoffline = Math.floor(masternodestotal - masternodesonline);
var masternodesoffline = Math.floor(masternodestotal.total - masternodestotal.enabled);
res.send({ data: [{
difficulty: difficulty,
difficultyHybrid: difficultyHybrid,
supply: stats.supply,
hashrate: hashrate,
lastPrice: stats.last_price,
connections: connections,
masternodeCountOnline: masternodesonline,
masternodeCountOnline: masternodestotal.enabled,
masternodeCountOffline: masternodesoffline,
blockcount: blockcount
}]});
});
});
});
});
});
Expand Down

0 comments on commit 5c97a82

Please sign in to comment.