aboutsummaryrefslogtreecommitdiff
path: root/ui.cpp
diff options
context:
space:
mode:
authorgavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-30 18:58:11 +0000
committergavinandresen <gavinandresen@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-11-30 18:58:11 +0000
commitbfd471f53e14c4218ae7a1544beb7f1de3e695b2 (patch)
treece973160466913efe4a091eb47da3e1f8b90f388 /ui.cpp
parent84d7c981dc52cc738053f9ec48648ab6fbf9311b (diff)
downloadbitcoin-bfd471f53e14c4218ae7a1544beb7f1de3e695b2.tar.xz
JSON methods: listtransactions, gettransaction, move, sendfrom and getbalance <account>
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@193 1a98c847-1fd6-4fd8-948a-caf3550aa51b
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/ui.cpp b/ui.cpp
index 321214fe51..213cf7666d 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -697,16 +697,13 @@ bool CMainFrame::InsertTransaction(const CWalletTx& wtx, bool fNew, int nIndex)
if (fAllFromMe && fAllToMe)
{
// Payment to self
- int64 nValue = wtx.vout[0].nValue;
+ int64 nChange = wtx.GetChange();
InsertLine(fNew, nIndex, hash, strSort, colour,
strStatus,
nTime ? DateTimeStr(nTime) : "",
_("Payment to yourself"),
- "",
- "");
- /// issue: can't tell which is the payment and which is the change anymore
- // FormatMoney(nNet - nValue, true),
- // FormatMoney(nValue, true));
+ FormatMoney(-(nDebit - nChange), true),
+ FormatMoney(nCredit - nChange, true));
}
else if (fAllFromMe)
{
@@ -1376,10 +1373,10 @@ CTxDetailsDialog::CTxDetailsDialog(wxWindow* parent, CWalletTx wtx) : CTxDetails
if (fAllToMe)
{
// Payment to self
- /// issue: can't tell which is the payment and which is the change anymore
- //int64 nValue = wtx.vout[0].nValue;
- //strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
- //strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
+ int64 nChange = wtx.GetChange();
+ int64 nValue = nCredit - nChange;
+ strHTML += _("<b>Debit:</b> ") + FormatMoney(-nValue) + "<br>";
+ strHTML += _("<b>Credit:</b> ") + FormatMoney(nValue) + "<br>";
}
int64 nTxFee = nDebit - wtx.GetValueOut();