Permalink
Browse files

update stats and dark theme colors

  • Loading branch information...
SkaZun committed Nov 29, 2018
1 parent 5e8ca53 commit ee5ae0ded7ac86707b73d18085aa28b94950fedf
Showing with 407 additions and 440 deletions.
  1. +15 −3 src/qt/clientmodel.cpp
  2. +380 −417 src/qt/forms/overviewpage.ui
  3. +11 −7 src/qt/overviewpage.cpp
  4. +1 −13 src/qt/res/dark/css/dark.css
@@ -176,11 +176,23 @@ void ClientModel::update24hStatsTimer()
}

// recalc stats data if new block found
if (currentBlock > blockLast) {
if (currentBlock > blockLast && statSourceData.size() > 0) {
// sorting vector and get stats values
sort(statSourceData.begin(), statSourceData.end(), sortStat);
posMin = statSourceData.front().second.txInValue;
posMax = statSourceData.back().second.txInValue;

if (statSourceData.size() > 100) {
CAmount posAverage = 0;
for (auto it = statSourceData.begin(); it != statSourceData.begin() + 100; ++it)
posAverage += it->second.txInValue;
posMin = posAverage / 100;
for (auto it = statSourceData.rbegin(); it != statSourceData.rbegin() + 100; ++it)
posAverage += it->second.txInValue;
posMax = posAverage / 100;
} else {
posMin = statSourceData.front().second.txInValue;
posMax = statSourceData.back().second.txInValue;
}

if (statSourceData.size() % 2) {
posMedian = (statSourceData[int(statSourceData.size()/2)].second.txInValue + statSourceData[int(statSourceData.size()/2)-1].second.txInValue) / 2;
} else {
Oops, something went wrong.

0 comments on commit ee5ae0d

Please sign in to comment.