Fix mining chart #48

Merged
marcdeb1 merged 2 commits from fix_mining_chart into master 2019-01-03 00:37:29 +01:00

View file

@ -85,7 +85,6 @@ function buildChartData(blockData) {
inflationRate = ((supply - lastYearSupply) / lastYearSupply) * 100; inflationRate = ((supply - lastYearSupply) / lastYearSupply) * 100;
if(i % skip == 0) { // Only push 1/<skip> of all blocks to optimize data loading if(i % skip == 0) { // Only push 1/<skip> of all blocks to optimize data loading
chartData.push({ chartData.push({
date: new Date(blockTime * 1000),
date: new Date(blockTime * 1000), date: new Date(blockTime * 1000),
AvailableSupply: supply, AvailableSupply: supply,
RewardLBC: reward, RewardLBC: reward,
@ -99,7 +98,7 @@ function buildChartData(blockData) {
function loadChartData() { function loadChartData() {
var api_url = "https://chainquery.lbry.io/api/sql?query="; var api_url = "https://chainquery.lbry.io/api/sql?query=";
var query = "SELECT id, block_time FROM block"; var query = "SELECT height, block_time FROM block WHERE confirmations > 0 ORDER BY height";
var url = api_url + query; var url = api_url + query;
var loadProgress = $('.mining-inflation-chart-container .load-progress'); var loadProgress = $('.mining-inflation-chart-container .load-progress');
$.ajax({ $.ajax({