wallet: if only have one output type, don't perform "mixed" coin selection #26668

pull furszy wants to merge 1 commits into bitcoin:master from furszy:2022_wallet_double_coin_selection changing 2 files +5 −2
  1. furszy commented at 8:06 PM on December 8, 2022: member

    For wallets that only have one output type, we are currently performing the same selection process over the same coins twice.

    The "mixed coin selection" doesn't add any value to the result (there is nothing to mix if the available coins struct has only one type).

  2. wallet: if only have one output type, don't perform "mixed" coin selection
    there is nothing to mix.
    89c1491d35
  3. DrahtBot commented at 8:06 PM on December 8, 2022: contributor

    <!--e57a25ab6845829454e8d69fc972939a-->

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

    <!--021abf342d371248e50ceaed478a90ca-->

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK john-moffett, achow101, kristapsk

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

    <!--174a7506f384e20aa4161008e828411d-->

    Conflicts

    Reviewers, this pull request conflicts with the following ones:

    • #26661 (wallet: Coin Selection, return accurate error messages by furszy)

    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.

  4. DrahtBot added the label Wallet on Dec 8, 2022
  5. john-moffett approved
  6. john-moffett commented at 6:16 PM on December 12, 2022: contributor

    ACK 89c1491d35389eac0c1fecc59333cdfae3b1bd2c

    It's not important to this code, but this comment:

    // If TypesCount() <= 1, there is nothing to mix.

    got me wondering whether you could get to here with TypesCount() == 0, and I don't think you can, due to https://github.com/bitcoin/bitcoin/blob/6061eb6564105ad54703a7cf3282590d0e1a7f28/src/wallet/spend.cpp#L599-L605

  7. furszy commented at 8:27 PM on December 12, 2022: member

    Yes @john-moffett, if TypesCount() == 0 then we have no coins, so we never perform coin selection.

  8. achow101 commented at 8:44 PM on December 13, 2022: member

    ACK 89c1491d35389eac0c1fecc59333cdfae3b1bd2c

  9. kristapsk approved
  10. kristapsk commented at 8:48 PM on December 13, 2022: contributor

    cr utACK 89c1491d35389eac0c1fecc59333cdfae3b1bd2c

  11. achow101 merged this on Dec 14, 2022
  12. achow101 closed this on Dec 14, 2022

  13. sidhujag referenced this in commit e65025357d on Dec 15, 2022
  14. furszy deleted the branch on May 27, 2023
  15. bitcoin locked this on May 26, 2024

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-16 00:13 UTC

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