|
|
@ -32,7 +32,7 @@ QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, int unit) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QString strHTML; |
|
|
|
QString strHTML; |
|
|
|
|
|
|
|
|
|
|
@ -129,7 +129,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
nUnmatured += wallet->GetCredit(txout); |
|
|
|
nUnmatured += wallet->GetCredit(txout); |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> "; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> "; |
|
|
|
if (wtx.IsInMainChain()) |
|
|
|
if (wtx.IsInMainChain()) |
|
|
|
strHTML += BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; |
|
|
|
strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")"; |
|
|
|
else |
|
|
|
else |
|
|
|
strHTML += "(" + tr("not accepted") + ")"; |
|
|
|
strHTML += "(" + tr("not accepted") + ")"; |
|
|
|
strHTML += "<br>"; |
|
|
|
strHTML += "<br>"; |
|
|
@ -139,7 +139,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
//
|
|
|
|
//
|
|
|
|
// Credit
|
|
|
|
// Credit
|
|
|
|
//
|
|
|
|
//
|
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nNet) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nNet) + "<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -175,7 +175,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -txout.nValue) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -txout.nValue) + "<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (fAllToMe) |
|
|
|
if (fAllToMe) |
|
|
@ -183,13 +183,13 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
// Payment to self
|
|
|
|
// Payment to self
|
|
|
|
int64 nChange = wtx.GetChange(); |
|
|
|
int64 nChange = wtx.GetChange(); |
|
|
|
int64 nValue = nCredit - nChange; |
|
|
|
int64 nValue = nCredit - nChange; |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -nValue) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nValue) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nValue) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nValue) + "<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int64 nTxFee = nDebit - GetValueOut(wtx); |
|
|
|
int64 nTxFee = nDebit - GetValueOut(wtx); |
|
|
|
if (nTxFee > 0) |
|
|
|
if (nTxFee > 0) |
|
|
|
strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -nTxFee) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nTxFee) + "<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
@ -198,14 +198,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
//
|
|
|
|
//
|
|
|
|
BOOST_FOREACH(const CTxIn& txin, wtx.vin) |
|
|
|
BOOST_FOREACH(const CTxIn& txin, wtx.vin) |
|
|
|
if (wallet->IsMine(txin)) |
|
|
|
if (wallet->IsMine(txin)) |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "<br>"; |
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
if (wallet->IsMine(txout)) |
|
|
|
if (wallet->IsMine(txout)) |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "<br>"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nNet, true) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nNet, true) + "<br>"; |
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// Message
|
|
|
|
// Message
|
|
|
@ -243,10 +243,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
strHTML += "<hr><br>" + tr("Debug information") + "<br><br>"; |
|
|
|
strHTML += "<hr><br>" + tr("Debug information") + "<br><br>"; |
|
|
|
BOOST_FOREACH(const CTxIn& txin, wtx.vin) |
|
|
|
BOOST_FOREACH(const CTxIn& txin, wtx.vin) |
|
|
|
if(wallet->IsMine(txin)) |
|
|
|
if(wallet->IsMine(txin)) |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin)) + "<br>"; |
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
BOOST_FOREACH(const CTxOut& txout, wtx.vout) |
|
|
|
if(wallet->IsMine(txout)) |
|
|
|
if(wallet->IsMine(txout)) |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>"; |
|
|
|
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout)) + "<br>"; |
|
|
|
|
|
|
|
|
|
|
|
strHTML += "<br><b>" + tr("Transaction") + ":</b><br>"; |
|
|
|
strHTML += "<br><b>" + tr("Transaction") + ":</b><br>"; |
|
|
|
strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); |
|
|
|
strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true); |
|
|
@ -274,7 +274,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) |
|
|
|
strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " "; |
|
|
|
strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " "; |
|
|
|
strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); |
|
|
|
strHTML += QString::fromStdString(CBitcoinAddress(address).ToString()); |
|
|
|
} |
|
|
|
} |
|
|
|
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, vout.nValue); |
|
|
|
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(unit, vout.nValue); |
|
|
|
strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + "</li>"; |
|
|
|
strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + "</li>"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|