annotate src/qt/transactiondesc.cpp @ 3679:1e67262f9a28 draft default tip master

Mention that Qt3 tools can cause build problems
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Tue, 23 Oct 2012 13:17:23 -0400 (2012-10-23)
parents 12e3ba3a9c4b
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2143
4bb59fe180f9 VC2010 compile fixes
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1739
diff changeset
1 #include "transactiondesc.h"
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
2
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
3 #include "guiutil.h"
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
4 #include "bitcoinunits.h"
1136
bbc8c23fb492 windows build fixes
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1105
diff changeset
5
2274
f2eba0cb504a Remove headers.h
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2190
diff changeset
6 #include "main.h"
f2eba0cb504a Remove headers.h
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2190
diff changeset
7 #include "wallet.h"
f2eba0cb504a Remove headers.h
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2190
diff changeset
8 #include "db.h"
2155
8c79f3b6cd53 Move from noui.h / ui.h to one ui_interface.h with dummy implementation for the daemon.
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 2143
diff changeset
9 #include "ui_interface.h"
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
10 #include "base58.h"
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
11
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
12 QString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
13 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
14 if (!wtx.IsFinal())
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
15 {
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
16 if (wtx.nLockTime < LOCKTIME_THRESHOLD)
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
17 return tr("Open for %n block(s)", "", nBestHeight - wtx.nLockTime);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
18 else
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
19 return tr("Open until %1").arg(GUIUtil::dateTimeStr(wtx.nLockTime));
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
20 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
21 else
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
22 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
23 int nDepth = wtx.GetDepthInMainChain();
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
24 if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
25 return tr("%1/offline").arg(nDepth);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
26 else if (nDepth < 6)
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
27 return tr("%1/unconfirmed").arg(nDepth);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
28 else
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
29 return tr("%1 confirmations").arg(nDepth);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
30 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
31 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
32
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
33 QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
34 {
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
35 QString strHTML;
2190
60fe81a4849b Use scoped locks instead of CRITICAL_BLOCK
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2155
diff changeset
36
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
37 {
2190
60fe81a4849b Use scoped locks instead of CRITICAL_BLOCK
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2155
diff changeset
38 LOCK(wallet->cs_wallet);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
39 strHTML.reserve(4000);
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
40 strHTML += "<html><font face='verdana, arial, helvetica, sans-serif'>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
41
1616
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
42 int64 nTime = wtx.GetTxTime();
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
43 int64 nCredit = wtx.GetCredit();
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
44 int64 nDebit = wtx.GetDebit();
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
45 int64 nNet = nCredit - nDebit;
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
46
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
47 strHTML += "<b>" + tr("Status") + ":</b> " + FormatTxStatus(wtx);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
48 int nRequests = wtx.GetRequestCount();
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
49 if (nRequests != -1)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
50 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
51 if (nRequests == 0)
1262
ee115fab6952 QtUI code cleanup / comment improvements
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1238
diff changeset
52 strHTML += tr(", has not been successfully broadcast yet");
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
53 else if (nRequests > 0)
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
54 strHTML += tr(", broadcast through %n node(s)", "", nRequests);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
55 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
56 strHTML += "<br>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
57
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
58 strHTML += "<b>" + tr("Date") + ":</b> " + (nTime ? GUIUtil::dateTimeStr(nTime) : "") + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
59
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
60 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
61 // From
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
62 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
63 if (wtx.IsCoinBase())
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
64 {
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
65 strHTML += "<b>" + tr("Source") + ":</b> " + tr("Generated") + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
66 }
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
67 else if (wtx.mapValue.count("from") && !wtx.mapValue["from"].empty())
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
68 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
69 // Online transaction
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
70 strHTML += "<b>" + tr("From") + ":</b> " + GUIUtil::HtmlEscape(wtx.mapValue["from"]) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
71 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
72 else
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
73 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
74 // Offline transaction
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
75 if (nNet > 0)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
76 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
77 // Credit
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
78 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
79 {
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
80 if (wallet->IsMine(txout))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
81 {
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
82 CTxDestination address;
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
83 if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
84 {
1220
e69e63528ec2 Merge remote branch 'upstream/master'
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1136
diff changeset
85 if (wallet->mapAddressBook.count(address))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
86 {
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
87 strHTML += "<b>" + tr("From") + ":</b> " + tr("unknown") + "<br>";
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
88 strHTML += "<b>" + tr("To") + ":</b> ";
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
89 strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString());
1220
e69e63528ec2 Merge remote branch 'upstream/master'
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1136
diff changeset
90 if (!wallet->mapAddressBook[address].empty())
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
91 strHTML += " (" + tr("own address") + ", " + tr("label") + ": " + GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + ")";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
92 else
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
93 strHTML += " (" + tr("own address") + ")";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
94 strHTML += "<br>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
95 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
96 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
97 break;
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
98 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
99 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
100 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
101 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
102
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
103 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
104 // To
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
105 //
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
106 if (wtx.mapValue.count("to") && !wtx.mapValue["to"].empty())
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
107 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
108 // Online transaction
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
109 std::string strAddress = wtx.mapValue["to"];
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
110 strHTML += "<b>" + tr("To") + ":</b> ";
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
111 CTxDestination dest = CBitcoinAddress(strAddress).Get();
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
112 if (wallet->mapAddressBook.count(dest) && !wallet->mapAddressBook[dest].empty())
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
113 strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[dest]) + " ";
1621
83335f03e38a Move HtmlEscape (escape for qt rich text controls) to qt gui utilities
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1618
diff changeset
114 strHTML += GUIUtil::HtmlEscape(strAddress) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
115 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
116
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
117 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
118 // Amount
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
119 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
120 if (wtx.IsCoinBase() && nCredit == 0)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
121 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
122 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
123 // Coinbase
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
124 //
1616
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
125 int64 nUnmatured = 0;
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
126 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
127 nUnmatured += wallet->GetCredit(txout);
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
128 strHTML += "<b>" + tr("Credit") + ":</b> ";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
129 if (wtx.IsInMainChain())
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
130 strHTML += BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
131 else
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
132 strHTML += "(" + tr("not accepted") + ")";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
133 strHTML += "<br>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
134 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
135 else if (nNet > 0)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
136 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
137 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
138 // Credit
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
139 //
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
140 strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nNet) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
141 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
142 else
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
143 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
144 bool fAllFromMe = true;
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
145 BOOST_FOREACH(const CTxIn& txin, wtx.vin)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
146 fAllFromMe = fAllFromMe && wallet->IsMine(txin);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
147
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
148 bool fAllToMe = true;
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
149 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
150 fAllToMe = fAllToMe && wallet->IsMine(txout);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
151
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
152 if (fAllFromMe)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
153 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
154 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
155 // Debit
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
156 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
157 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
158 {
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
159 if (wallet->IsMine(txout))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
160 continue;
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
161
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
162 if (!wtx.mapValue.count("to") || wtx.mapValue["to"].empty())
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
163 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
164 // Offline transaction
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
165 CTxDestination address;
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
166 if (ExtractDestination(txout.scriptPubKey, address))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
167 {
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
168 strHTML += "<b>" + tr("To") + ":</b> ";
1220
e69e63528ec2 Merge remote branch 'upstream/master'
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1136
diff changeset
169 if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
1621
83335f03e38a Move HtmlEscape (escape for qt rich text controls) to qt gui utilities
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1618
diff changeset
170 strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + " ";
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
171 strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString());
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
172 strHTML += "<br>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
173 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
174 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
175
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
176 strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -txout.nValue) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
177 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
178
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
179 if (fAllToMe)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
180 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
181 // Payment to self
1616
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
182 int64 nChange = wtx.GetChange();
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
183 int64 nValue = nCredit - nChange;
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
184 strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -nValue) + "<br>";
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
185 strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nValue) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
186 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
187
1616
997b708d15b8 Revert "Use standard C99 (and Qt) types for 64-bit integers"
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1615
diff changeset
188 int64 nTxFee = nDebit - wtx.GetValueOut();
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
189 if (nTxFee > 0)
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
190 strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -nTxFee) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
191 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
192 else
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
193 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
194 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
195 // Mixed debit transaction
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
196 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
197 BOOST_FOREACH(const CTxIn& txin, wtx.vin)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
198 if (wallet->IsMine(txin))
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
199 strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
200 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
201 if (wallet->IsMine(txout))
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
202 strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
203 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
204 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
205
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
206 strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, nNet, true) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
207
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
208 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
209 // Message
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
210 //
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
211 if (wtx.mapValue.count("message") && !wtx.mapValue["message"].empty())
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
212 strHTML += "<br><b>" + tr("Message") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["message"], true) + "<br>";
3559
5cda6dd530bf toHTML won't add empty wtx.mapValue elements
xanatos <xanatos@geocities.com>
parents: 3137
diff changeset
213 if (wtx.mapValue.count("comment") && !wtx.mapValue["comment"].empty())
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
214 strHTML += "<br><b>" + tr("Comment") + ":</b><br>" + GUIUtil::HtmlEscape(wtx.mapValue["comment"], true) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
215
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
216 strHTML += "<b>" + tr("Transaction ID") + ":</b> " + wtx.GetHash().ToString().c_str() + "<br>";
1739
2c403a8c2195 Qt: Show transaction ID in details
Luke Dashjr <luke-jr+git@utopios.org>
parents: 1621
diff changeset
217
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
218 if (wtx.IsCoinBase())
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
219 strHTML += "<br>" + tr("Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \"not accepted\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.") + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
220
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
221 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
222 // Debug view
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
223 //
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
224 if (fDebug)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
225 {
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
226 strHTML += "<hr><br>" + tr("Debug information") + "<br><br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
227 BOOST_FOREACH(const CTxIn& txin, wtx.vin)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
228 if(wallet->IsMine(txin))
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
229 strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, -wallet->GetDebit(txin)) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
230 BOOST_FOREACH(const CTxOut& txout, wtx.vout)
1105
f14310dc690b update core to d0d80170a2ca73004e08fb85007fe055cbf4e411 (CWallet class)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1101
diff changeset
231 if(wallet->IsMine(txout))
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
232 strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, wallet->GetCredit(txout)) + "<br>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
233
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
234 strHTML += "<br><b>" + tr("Transaction") + ":</b><br>";
1621
83335f03e38a Move HtmlEscape (escape for qt rich text controls) to qt gui utilities
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1618
diff changeset
235 strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
236
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
237 strHTML += "<br><b>" + tr("Inputs") + ":</b>";
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
238 strHTML += "<ul>";
2190
60fe81a4849b Use scoped locks instead of CRITICAL_BLOCK
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2155
diff changeset
239
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
240 {
2190
60fe81a4849b Use scoped locks instead of CRITICAL_BLOCK
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2155
diff changeset
241 LOCK(wallet->cs_wallet);
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
242 BOOST_FOREACH(const CTxIn& txin, wtx.vin)
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
243 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
244 COutPoint prevout = txin.prevout;
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
245
3649
eb986f1e2e93 Ultraprune
Pieter Wuille <pieter.wuille@gmail.com>
parents: 3559
diff changeset
246 CCoins prev;
3650
12e3ba3a9c4b Batch block connection during IBD
Pieter Wuille <pieter.wuille@gmail.com>
parents: 3649
diff changeset
247 if(pcoinsTip->GetCoins(prevout.hash, prev))
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
248 {
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
249 if (prevout.n < prev.vout.size())
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
250 {
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
251 strHTML += "<li>";
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
252 const CTxOut &vout = prev.vout[prevout.n];
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
253 CTxDestination address;
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
254 if (ExtractDestination(vout.scriptPubKey, address))
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
255 {
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
256 if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
1621
83335f03e38a Move HtmlEscape (escape for qt rich text controls) to qt gui utilities
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1618
diff changeset
257 strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + " ";
2688
2c65e5d626eb Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddress
Pieter Wuille <pieter.wuille@gmail.com>
parents: 2274
diff changeset
258 strHTML += QString::fromStdString(CBitcoinAddress(address).ToString());
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
259 }
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
260 strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(BitcoinUnits::BTC, vout.nValue);
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
261 strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) ? tr("true") : tr("false")) + "</li>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
262 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
263 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
264 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
265 }
3137
fdc304042f75 enhance translation possibilities in TransactionDesc / misc other changes
Philip Kaufmann <phil.kaufmann@t-online.de>
parents: 3126
diff changeset
266
1232
d8e425ad0c2b Make debug info more interesting (show SHA160 addresses for inputs)
Wladimir J. van der Laan <laanwj@gmail.com>
parents: 1228
diff changeset
267 strHTML += "</ul>";
1049
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
268 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
269
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
270 strHTML += "</font></html>";
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
271 }
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
272 return strHTML;
e5518d9b9f05 move back to original directory structure
Wladimir J. van der Laan <laanwj@gmail.com>
parents:
diff changeset
273 }