Commit 9192ef61 authored by coin-server's avatar coin-server

Merge branch '9-wallet-explorer' into 'master'

Resolve "Wallet Explorer"

Closes #9

See merge request ProjectMerge/merge!28
parents 1cddeda5 079068ee
......@@ -200,9 +200,17 @@ std::string BlockToString(CBlockIndex* pBlock)
CAmount Fees = 0;
CAmount OutVolume = 0;
CAmount Reward = 0;
CAmount Generated;
// Get the Current Block Reward
if (pBlock->nHeight == 0)
Generated = OutVolume;
else
Generated = GetBlockValue(pBlock->nHeight - 1);
std::string TxLabels[] = {_("Hash"), _("From"), _("Amount"), _("To"), _("Amount")};
//Loop trough every incomming Tx
std::string TxContent = table + makeHTMLTableRow(TxLabels, sizeof(TxLabels) / sizeof(std::string));
for (unsigned int i = 0; i < block.vtx.size(); i++) {
const CTransaction& tx = block.vtx[i];
......@@ -210,27 +218,21 @@ std::string BlockToString(CBlockIndex* pBlock)
CAmount In = getTxIn(tx);
CAmount Out = tx.GetValueOut();
if (tx.IsCoinBase())
Reward += Out;
else if (In < 0)
Fees = -Params().MaxMoneyOut();
if (In < 0)
Fees = -Params().MaxMoneyOut();
else {
Fees += In - Out;
Fees += Out - In - ((block.vtx.size() == i + 1) ? Generated : 0);
OutVolume += Out;
}
}
TxContent += "</table>";
CAmount Generated;
if (pBlock->nHeight == 0)
Generated = OutVolume;
else
Generated = GetBlockValue(pBlock->nHeight - 1);
std::string BlockContentCells[] =
{
_("Height"), itostr(pBlock->nHeight),
_("Size"), itostr(GetSerializeSize(block, SER_NETWORK, PROTOCOL_VERSION)),
_("Algorithm"),(pBlock->IsProofOfWork()) ? "POW" : "POS",
_("Number of Transactions"), itostr(block.vtx.size()),
_("Value Out"), ValueToString(OutVolume),
_("Fees"), ValueToString(Fees),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment