wallet: Change output type globals to members #12408

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1802-walletChangeTypeMember changing 16 files +84 −92
  1. MarcoFalke commented at 2:29 am on February 11, 2018: member

    Output type is used by the wallet when generating addresses or transactions with change, thus it should be a member of CWallet.

    Moreover, in light of multiwallet, it makes sense to prepare for per-wallet attributes instead of for-all-wallets globals.

  2. MarcoFalke added the label Wallet on Feb 11, 2018
  3. MarcoFalke added the label Refactoring on Feb 11, 2018
  4. randolf commented at 2:43 am on February 11, 2018: contributor
    Concept ACK. This seems very good in principle, and moving toward multi-wallet support looks like a rational use case to me.
  5. MarcoFalke force-pushed on Feb 11, 2018
  6. MarcoFalke added this to the milestone 0.16.1 on Feb 11, 2018
  7. promag commented at 10:04 am on February 11, 2018: member

    utACK fab8778.

    How do you plan to have different types for different wallets?

  8. jonasschnelli commented at 9:08 am on February 12, 2018: contributor
    Concept ACK
  9. laanwj commented at 9:57 am on February 12, 2018: member
    Concept ACK
  10. in src/wallet/wallet.cpp:4024 in fab877817a outdated
    4019+    if (walletInstance->m_change_type == OutputType::NONE && !gArgs.GetArg("-changetype", "").empty()) {
    4020+        InitError(strprintf("Unknown change type '%s'", gArgs.GetArg("-changetype", "")));
    4021+        return nullptr;
    4022+    }
    4023+
    4024+
    


    Sjors commented at 6:37 pm on February 12, 2018:
    Nit: unnecessary empty line

    MarcoFalke commented at 7:12 pm on February 12, 2018:
    Sorry. Will keep the white space for now, to not invalidate review.
  11. Sjors approved
  12. Sjors commented at 6:52 pm on February 12, 2018: member
    Tested ACK fab87781
  13. MarcoFalke removed this from the milestone 0.16.1 on Feb 14, 2018
  14. MarcoFalke force-pushed on Feb 16, 2018
  15. MarcoFalke force-pushed on Feb 16, 2018
  16. MarcoFalke commented at 6:58 pm on February 16, 2018: member
    Trivially rebased and fixed whitespace-nit. Should be easy to re-ACK if you still have the commit locally.
  17. Sjors commented at 2:06 pm on February 20, 2018: member
    re-ACK fa9d869. I also checked that #12424 didn’t come back, since this latest commit undoes that.
  18. instagibbs commented at 7:53 pm on February 27, 2018: member

    utACK https://github.com/bitcoin/bitcoin/pull/12408/commits/fa9d869d0beec2e6b87c4b88d7226e78864f9e10

    I echo @promag ’s question. Out of scope for now, but would be good to know.

  19. in src/wallet/wallet.h:797 in fa9d869d0b outdated
    803@@ -808,6 +804,8 @@ class CWallet final : public CCryptoKeyStore, public CValidationInterface
    804 
    805     void SetNull()
    806     {
    807+        m_address_type = OutputType::NONE;
    


    ryanofsky commented at 3:58 pm on March 1, 2018:
    Is there a reason we can’t set these to DEFAULT instead of NONE? Using DEFAULT would seem to be better because it would simplify test and test fixture setup in various places. Or if these do have to be NONE, it would be good to have a comment saying why, since the reason isn’t obvious.

    promag commented at 5:36 pm on March 1, 2018:
    I think only address type can be DEFAULT, there is use case NONE change type (change_type = g_change_type != OUTPUT_TYPE_NONE ? g_change_type : g_address_type).
  20. ryanofsky commented at 4:20 pm on March 1, 2018: member

    utACK fa9d869d0beec2e6b87c4b88d7226e78864f9e10

    Just a suggestion, but I think switching to m_default_address_type instead of m_address_type and GetDefaultAddressType instead of GetWalletAddressType (and similarly for change) might be a little more clear and consistent.

  21. ryanofsky commented at 4:57 pm on March 1, 2018: member

    How do you plan to have different types for different wallets?

    I think the answer would depend on what the use case for per-wallet output types is (assuming there is a use case).

    If the address/change types for a wallet are supposed to be stable, they should probably be determined from the database, either by being stored explicitly, or by being derived from the wallet version number. In this case the output types should be persistent and controllable by RPC.

    Alternately, if the output types should just be runtime settings, we could follow sqlite’s example and allow specifying per-file options with uri query parameters, for example: "-wallet=name?addresstype=bech32".

  22. promag commented at 5:36 pm on March 1, 2018: member

    switching to m_default_address_type instead of m_address_type and GetDefaultAddressType instead of GetWalletAddressType @ryanofsky 👍

  23. promag commented at 5:05 pm on March 16, 2018: member
    Needs rebase.
  24. MarcoFalke force-pushed on Mar 17, 2018
  25. MarcoFalke force-pushed on Mar 17, 2018
  26. MarcoFalke force-pushed on Mar 17, 2018
  27. MarcoFalke force-pushed on Mar 17, 2018
  28. wallet: Change output type globals to members fab8a6f609
  29. MarcoFalke commented at 8:10 pm on March 17, 2018: member
    Addressed feedback by removing OutputType::DEFAULT.
  30. MarcoFalke force-pushed on Mar 17, 2018
  31. laanwj merged this on Mar 19, 2018
  32. laanwj closed this on Mar 19, 2018

  33. laanwj referenced this in commit c39dd2ef59 on Mar 19, 2018
  34. MarcoFalke deleted the branch on Mar 19, 2018
  35. laanwj referenced this in commit 979150bc23 on May 3, 2018
  36. TheArbitrator referenced this in commit d0fefe7ec9 on Jun 21, 2021
  37. MarcoFalke locked this on Sep 8, 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: 2024-11-17 09:12 UTC

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