mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-03 09:56:38 -05:00
Show addresses for "SendToSelf" transactions
Change addresses are not recognized.
This commit is contained in:
parent
1d73636fdf
commit
11fdfcf7f9
2 changed files with 8 additions and 3 deletions
|
@ -93,10 +93,14 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
|
||||||
if (fAllFromMe && fAllToMe)
|
if (fAllFromMe && fAllToMe)
|
||||||
{
|
{
|
||||||
// Payment to self
|
// Payment to self
|
||||||
CAmount nChange = wtx.change;
|
std::string address;
|
||||||
|
for (auto it = wtx.txout_address.begin(); it != wtx.txout_address.end(); ++it) {
|
||||||
|
if (it != wtx.txout_address.begin()) address += ", ";
|
||||||
|
address += EncodeDestination(*it);
|
||||||
|
}
|
||||||
|
|
||||||
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
|
CAmount nChange = wtx.change;
|
||||||
-(nDebit - nChange), nCredit - nChange));
|
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, address, -(nDebit - nChange), nCredit - nChange));
|
||||||
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
|
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
|
||||||
}
|
}
|
||||||
else if (fAllFromMe)
|
else if (fAllFromMe)
|
||||||
|
|
|
@ -395,6 +395,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
|
||||||
case TransactionRecord::SendToOther:
|
case TransactionRecord::SendToOther:
|
||||||
return QString::fromStdString(wtx->address) + watchAddress;
|
return QString::fromStdString(wtx->address) + watchAddress;
|
||||||
case TransactionRecord::SendToSelf:
|
case TransactionRecord::SendToSelf:
|
||||||
|
return lookupAddress(wtx->address, tooltip) + watchAddress;
|
||||||
default:
|
default:
|
||||||
return tr("(n/a)") + watchAddress;
|
return tr("(n/a)") + watchAddress;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue