qt: Show addresses for "SendToSelf" transactions #15098

pull hebasto wants to merge 1 commits into bitcoin:master from hebasto:20190104-gui-self-payment changing 2 files +8 −3
  1. hebasto commented at 7:26 AM on January 4, 2019: member

    Fix #11464 Fix #12688 Ref: #11471 by jonasschnelli

    Note: change addresses are not recognized (ref: #11471 (review))

    Result: screenshot from 2019-01-04 09-06-12

  2. fanquake added the label GUI on Jan 4, 2019
  3. promag commented at 12:57 PM on January 4, 2019: member

    I had a different approach based on #12578 which would a row for each ismine output.

  4. Show addresses for "SendToSelf" transactions
    Change addresses are not recognized.
    11fdfcf7f9
  5. in src/qt/transactionrecord.cpp:96 in 212e06c80b outdated
      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 = "";
    


    practicalswift commented at 3:46 PM on January 5, 2019:

    Redundant string initialization here: std::string address; is enough :-)

  6. hebasto force-pushed on Jan 6, 2019
  7. hebasto commented at 9:56 AM on January 6, 2019: member

    @practicalswift thank you for your review. Your comment has been addressed.

  8. hebasto commented at 11:55 AM on January 6, 2019: member

    @promag

    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)

  9. hebasto commented at 2:56 PM on January 6, 2019: member

    Also this PR will fix #12688. Description has been updated.

  10. DrahtBot commented at 10:51 PM on January 9, 2019: member

    <!--e57a25ab6845829454e8d69fc972939a-->

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #15115 (GUI: Replace send-to-self with dual send+receive entries by luke-jr)

    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.

  11. meshcollider commented at 3:55 AM on April 14, 2019: contributor

    Concept ACK

  12. jonasschnelli commented at 4:03 PM on April 23, 2019: contributor

    Needs more review (maybe @fanquake @promag ?) Since @meshcollider @practicalswift commented, maybe continue with the review (ack/nack/comment).

  13. meshcollider commented at 10:07 PM on August 16, 2019: contributor

    LGTM, just did a quick code-read 11fdfcf7f940fab48625d102e825a59c16ad4fbc

  14. jonasschnelli added this to the milestone 0.20.0 on Oct 9, 2019
  15. jonasschnelli commented at 9:50 AM on October 9, 2019: contributor

    Tested ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc

  16. fanquake commented at 6:35 PM on October 9, 2019: member

    ACK 11fdfcf7f940fab48625d102e825a59c16ad4fbc - did the bare minimum testing.

    master (): master

    PR (11fdfcf7f940fab48625d102e825a59c16ad4fbc): pr

  17. fanquake referenced this in commit a2ae766a61 on Oct 9, 2019
  18. fanquake merged this on Oct 9, 2019
  19. fanquake closed this on Oct 9, 2019

  20. MarcoFalke commented at 6:56 PM on October 9, 2019: member

    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));
    
  21. sidhujag referenced this in commit ceec215816 on Oct 9, 2019
  22. hebasto deleted the branch on Oct 11, 2019
  23. MarkLTZ referenced this in commit e0d0fb53f9 on Nov 17, 2019
  24. jasonbcox referenced this in commit 16f28961a9 on Oct 27, 2020
  25. xdustinface referenced this in commit 3ca59d8bbb on Nov 20, 2020
  26. DrahtBot locked this on Dec 16, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 18:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me