Fix #11464 Fix #12688 Ref: #11471 by jonasschnelli
Note: change addresses are not recognized (ref: #11471 (review))
Result:

Fix #11464 Fix #12688 Ref: #11471 by jonasschnelli
Note: change addresses are not recognized (ref: #11471 (review))
Result:

Change addresses are not recognized.
92 | @@ -93,10 +93,14 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface 93 | if (fAllFromMe && fAllToMe) 94 | { 95 | // Payment to self 96 | - CAmount nChange = wtx.change; 97 | + std::string address = "";
Redundant string initialization here: std::string address; is enough :-)
@practicalswift thank you for your review. Your comment has been addressed.
I had a different approach based on #12578 which would a row for each ismine output.
Current #12578 does not help here; see: #12578 (comment)
<!--e57a25ab6845829454e8d69fc972939a-->
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
<!--174a7506f384e20aa4161008e828411d-->
Reviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
Concept ACK
Needs more review (maybe @fanquake @promag ?) Since @meshcollider @practicalswift commented, maybe continue with the review (ack/nack/comment).
LGTM, just did a quick code-read 11fdfcf7f940fab48625d102e825a59c16ad4fbc
Tested ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc
ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc - did the bare minimum testing.
master ():

PR (11fdfcf7f940fab48625d102e825a59c16ad4fbc):

post-merge ACK, could have used the string util Join for a one-liner:
diff --git a/src/qt/transactionrecord.cpp b/src/qt/transactionrecord.cpp
index 08ba030d65..24339eae17 100644
--- a/src/qt/transactionrecord.cpp
+++ b/src/qt/transactionrecord.cpp
@@ -7,6 +7,7 @@
#include <chain.h>
#include <interfaces/wallet.h>
#include <key_io.h>
+#include <util/string.h>
#include <wallet/ismine.h>
#include <stdint.h>
@@ -93,11 +94,7 @@ QList<TransactionRecord> TransactionRecord::decomposeTransaction(const interface
if (fAllFromMe && fAllToMe)
{
// Payment to self
- 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);
- }
+ const std::string address = Join(wtx.txout_address, ", ", [](const CTxDestination& d) { return EncodeDestination(d); });
CAmount nChange = wtx.change;
parts.append(TransactionRecord(hash, nTime, TransactionRecord::SendToSelf, address, -(nDebit - nChange), nCredit - nChange));
Milestone
0.20.0