Permalink
Browse files

Add money supply to BB

  • Loading branch information...
Tranz5 committed Nov 11, 2014
1 parent 772868e commit b082fd2882a1bf6775d699c5fd57ff2a720af29a
Showing with 14 additions and 0 deletions.
  1. +13 −0 src/qt/blockbrowser.cpp
  2. +1 −0 src/qt/blockbrowser.h
@@ -107,6 +107,18 @@ double getTxTotalValue(std::string txid)
return value;
}
double getMoneySupply(qint64 Height)
{
std::string strHash = getBlockHash(Height);
uint256 hash(strHash);
if (mapBlockIndex.count(hash) == 0)
return 0;
CBlockIndex* pblockindex = mapBlockIndex[hash];
return convertCoins(pblockindex->nMoneySupply);
}
double convertCoins(qint64 amount)
{
// Tranz needs to use options model.
@@ -262,6 +274,7 @@ void BlockBrowser::updateExplorer(bool block)
ui->diffLabel->setText("PoW Block Difficulty:");
ui->hashRateBox->setText(QString::number(GetPoWMHashPS(pindex), 'f', 3) + " MH/s");
}
ui->moneySupplyBox->setText(QString::number(getMoneySupply(height), 'f', 6) + " HBN");
}
else {
std::string txid = ui->txBox->text().toUtf8().constData();
@@ -38,6 +38,7 @@ public slots:
};
double getTxTotalValue(std::string);
double getMoneySupply(qint64 Height);
double convertCoins(qint64);
qint64 getBlockTime(qint64);
qint64 getBlocknBits(qint64);

0 comments on commit b082fd2

Please sign in to comment.