From: fsb4000 Date: Mon, 1 Dec 2014 14:43:50 +0000 (+0600) Subject: senderAddress X-Git-Tag: nvc-v0.5.0~11^2~2 X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=commitdiff_plain;h=2c0dca357581c34b3f0555bab24b3797610d02dd senderAddress --- diff --git a/src/qt/transactiondesc.cpp b/src/qt/transactiondesc.cpp index f6d9c8c..543a40c 100644 --- a/src/qt/transactiondesc.cpp +++ b/src/qt/transactiondesc.cpp @@ -84,7 +84,30 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx) { if (wallet->mapAddressBook.count(address)) { - strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + for (unsigned int i = 0; i < wtx.vin.size(); i++) + { + uint256 hash; + const CTxIn& vin = wtx.vin[i]; + hash.SetHex(vin.prevout.hash.ToString()); + CTransaction wtxPrev; + uint256 hashBlock = 0; + if (!GetTransaction(hash, wtxPrev, hashBlock)) + { + strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + continue; + } + CTxDestination senderAddress; + if (!ExtractDestination(wtxPrev.vout[vin.prevout.n].scriptPubKey, senderAddress) ) + { + strHTML += "" + tr("From") + ": " + tr("unknown") + "
"; + } + else + { + strHTML += "" + tr("From") + ": "; + strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(senderAddress).ToString()); + strHTML += "
"; + } + } strHTML += "" + tr("To") + ": "; strHTML += GUIUtil::HtmlEscape(CBitcoinAddress(address).ToString()); if (!wallet->mapAddressBook[address].empty())