From e66da342606c4d1b138c3f85c4b1064cbf52745d Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Sun, 11 Nov 2018 11:03:54 -0700 Subject: [PATCH] server: Remove 6k from the supplies (temporal fix) It looks like the supplies are not being computed correctly, this temporal fix allow us to have an accurate number while having time to investigate the issue. --- .../explorer/data/anorm/dao/StatisticsPostgresDAO.scala | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/app/com/xsn/explorer/data/anorm/dao/StatisticsPostgresDAO.scala b/server/app/com/xsn/explorer/data/anorm/dao/StatisticsPostgresDAO.scala index ea8d3ae..740d2fc 100644 --- a/server/app/com/xsn/explorer/data/anorm/dao/StatisticsPostgresDAO.scala +++ b/server/app/com/xsn/explorer/data/anorm/dao/StatisticsPostgresDAO.scala @@ -11,7 +11,7 @@ class StatisticsPostgresDAO { import StatisticsPostgresDAO._ def getStatistics(implicit conn: Connection): Statistics = { - SQL( + val result = SQL( s""" |SELECT | ( @@ -26,6 +26,11 @@ class StatisticsPostgresDAO { | (SELECT COALESCE(MAX(height), 0) FROM blocks) AS blocks """.stripMargin ).as(StatisticsParsers.parseStatistics.single) + + val shiftBy = BigDecimal(6000000) + val totalSupply = result.totalSupply.map(x => (x - shiftBy) max 0) + val circulatingSupply = result.circulatingSupply.map(x => (x - shiftBy) max 0) + result.copy(totalSupply = totalSupply, circulatingSupply = circulatingSupply) } }