aboutsummaryrefslogtreecommitdiff
path: root/src/qt/transactionrecord.cpp
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2019-10-09 14:16:38 -0400
committerfanquake <fanquake@gmail.com>2019-10-09 14:35:29 -0400
commita2ae766a61f0f4f70b504f68049218af1b9fa5c1 (patch)
tree2730e6cee8ad33f8e298261e5e822a155aa084c3 /src/qt/transactionrecord.cpp
parent1c11e53bb604835afd838f4520d3fdba25521c5b (diff)
parent11fdfcf7f940fab48625d102e825a59c16ad4fbc (diff)
Merge #15098: qt: Show addresses for "SendToSelf" transactions
11fdfcf7f940fab48625d102e825a59c16ad4fbc Show addresses for "SendToSelf" transactions (Hennadii Stepanov) Pull request description: Fix #11464 Fix #12688 Ref: #11471 by jonasschnelli Note: change addresses are not recognized (ref: https://github.com/bitcoin/bitcoin/pull/11471#discussion_r180547041) Result: ![screenshot from 2019-01-04 09-06-12](https://user-images.githubusercontent.com/32963518/50677356-19c79500-1002-11e9-986c-999c366e4b2a.png) ACKs for top commit: jonasschnelli: Tested ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc fanquake: ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc - did the bare minimum testing. Tree-SHA512: 2678a2fdf017c376750c73fdc751b7838b0d3a970ba02e9032e4c5824494362672036c3ebf87b425aefdfe197fb952b70e4b7b6011077abb39a8bfc1ae14dfd2
Diffstat (limited to 'src/qt/transactionrecord.cpp')
-rw-r--r--src/qt/transactionrecord.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 9de90759fa..08ba030d65 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -93,10 +93,14 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
if (fAllFromMe && fAllToMe)
{
// 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, "",
- -(nDebit - nChange), nCredit - nChange));
+ CAmount nChange = wtx.change;
+ parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, address, -(nDebit - nChange), nCredit - nChange));
parts.last().involvesWatchAddress = involvesWatchAddress; // maybe pass to TransactionRecord as constructor argument
}
else if (fAllFromMe)