aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactiondesc.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2011-07-26 15:38:31 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2011-07-26 16:47:23 +0200
commit491ad6db507776054c38230387f384991f42ad29 (patch)
tree7d708a59cb5f61f9d970950c528889dec8fde8d5 /src/qt/transactiondesc.cpp
parentc0b892fee89cba7d1fda5fda2d2fc7e966643be1 (diff)
parenta9ba47101a46533ff0418d6868ebc9bf5c889818 (diff)
Merge remote branch 'upstream/master'
Conflicts: src/bitcoinrpc.cpp
Diffstat (limited to 'src/qt/transactiondesc.cpp')
-rw-r--r--src/qt/transactiondesc.cpp24
1 files changed, 11 insertions, 13 deletions
diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp
index 809e473060..7f4bebb3fb 100644
--- a/src/qt/transactiondesc.cpp
+++ b/src/qt/transactiondesc.cpp
@@ -125,17 +125,16 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
{
if (wallet->IsMine(txout))
{
- vector<unsigned char> vchPubKey;
- if (ExtractPubKey(txout.scriptPubKey, wallet, vchPubKey))
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, wallet, address))
{
- string strAddress = PubKeyToAddress(vchPubKey);
- if (wallet->mapAddressBook.count(strAddress))
+ if (wallet->mapAddressBook.count(address))
{
strHTML += string() + _("<b>From:</b> ") + _("unknown") + "<br>";
strHTML += _("<b>To:</b> ");
- strHTML += HtmlEscape(strAddress);
- if (!wallet->mapAddressBook[strAddress].empty())
- strHTML += _(" (yours, label: ") + wallet->mapAddressBook[strAddress] + ")";
+ strHTML += HtmlEscape(address.ToString());
+ if (!wallet->mapAddressBook[address].empty())
+ strHTML += _(" (yours, label: ") + wallet->mapAddressBook[address] + ")";
else
strHTML += _(" (yours)");
strHTML += "<br>";
@@ -211,14 +210,13 @@ string TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)
if (wtx.mapValue["to"].empty())
{
// Offline transaction
- uint160 hash160;
- if (ExtractHash160(txout.scriptPubKey, hash160))
+ CBitcoinAddress address;
+ if (ExtractAddress(txout.scriptPubKey, wallet, address))
{
- string strAddress = Hash160ToAddress(hash160);
strHTML += _("<b>To:</b> ");
- if (wallet->mapAddressBook.count(strAddress) && !wallet->mapAddressBook[strAddress].empty())
- strHTML += wallet->mapAddressBook[strAddress] + " ";
- strHTML += strAddress;
+ if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())
+ strHTML += wallet->mapAddressBook[address] + " ";
+ strHTML += address.ToString();
strHTML += "<br>";
}
}