Skip to content

Commit 11fdfcf

Browse files
committed
Show addresses for "SendToSelf" transactions
Change addresses are not recognized.
1 parent 1d73636 commit 11fdfcf

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/qt/transactionrecord.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,14 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
9393
if (fAllFromMe && fAllToMe)
9494
{
9595
// Payment to self
96-
CAmount nChange = wtx.change;
96+
std::string address;
97+
for (auto it = wtx.txout_address.begin(); it != wtx.txout_address.end(); ++it) {
98+
if (it != wtx.txout_address.begin()) address += ", ";
99+
address += EncodeDestination(*it);
100+
}
97101

98-
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, "",
99-
-(nDebit - nChange), nCredit - nChange));
102+
CAmount nChange = wtx.change;
103+
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, address, -(nDebit - nChange), nCredit - nChange));
100104
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
101105
}
102106
else if (fAllFromMe)

src/qt/transactiontablemodel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ QString TransactionTableModel::formatTxToAddress(const TransactionRecord *wtx, b
395395
case TransactionRecord::SendToOther:
396396
return QString::fromStdString(wtx->address) + watchAddress;
397397
case TransactionRecord::SendToSelf:
398+
return lookupAddress(wtx->address, tooltip) + watchAddress;
398399
default:
399400
return tr("(n/a)") + watchAddress;
400401
}

0 commit comments

Comments
 (0)