#include "wallet.h"
#include "base58.h"
+extern CWallet* pwalletMain;
+
/* Return positive answer if transaction should be shown in list.
*/
bool TransactionRecord::showTransaction(const CWalletTx &wtx)
if(wallet->IsMine(txout))
{
TransactionRecord sub(hash, nTime);
- CTxDestination address;
sub.idx = parts.size(); // sequence number
sub.credit = txout.nValue;
- if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))
+
+ std::string address;
+ if (pwalletMain->ExtractAddress(txout.scriptPubKey, address))
{
- // Received by Bitcoin Address
sub.type = TransactionRecord::RecvWithAddress;
- sub.address = CBitcoinAddress(address).ToString();
+ sub.address = address;
}
else
{
sub.type = TransactionRecord::RecvFromOther;
sub.address = mapValue["from"];
}
+
if (wtx.IsCoinBase())
{
// Generated (proof-of-work)