Option to ignore small inputs when internal wallet is building TXes? #20870

issue Crypto2 opened this issue on January 6, 2021
  1. Crypto2 commented at 9:57 PM on January 6, 2021: none

    This is mainly to aid in not sending TXes with a ton of fees due to using a lot of tiny inputs, an option in the config file to tell it to ignore inputs with a value less than X when doing coin selection would be useful.

    Then you can do consolidation with manually built TXes or coin control whenever you want specifying lower fees, etc. for them.

  2. Crypto2 added the label Feature on Jan 6, 2021
  3. ghost commented at 8:12 PM on January 11, 2021: none
  4. willcl-ark commented at 10:58 AM on March 8, 2023: member

    @Crypto2 can you not just do the inverse and use coin selection/manual construction when you want to exclude small outputs?

  5. Crypto2 commented at 1:36 PM on March 8, 2023: none

    We already sweep them daily with scripts so they don't build up, would just be nice for them to not be spent automatically in between sweeps so it wouldn't have to be done as often.

  6. sipa commented at 1:38 PM on March 8, 2023: member

    The coin selection algorithm should automatically avoid small inputs if they're uneconomical to spend (depending on feerate).

  7. Crypto2 commented at 1:43 PM on March 8, 2023: none

    It doesn't seem to a lot of the time, or it just has it's own idea of what's economical lol.

  8. sipa commented at 1:52 PM on March 8, 2023: member

    @Crypto2 Examples would be very helpful to see where the algorithm can be improved.

    That's of course orthogonal to providing an option like the one you're asking for, but I did want to point out that the system is already designed so that this shouldn't be necessary in general. If that system isn't doing its job, it seems higher priority to address (or at least investigate) that, as it could affect a lot more people.

  9. furszy commented at 1:55 PM on March 8, 2023: member

    If you have a high number of small inputs (to the point of exceeding the max weight), you might be experiencing what #26720 is fixing.

  10. Xekyo commented at 8:31 PM on March 10, 2023: member

    The Knapsack algorithm was kept as is, and still always permits uneconomical UTXOs. So, occasionally, the input set proposed by Knapsack could include an uneconomical UTXO in its inputs and still be the least wasteful input set overall. I would suggest that we remove Knapsack, and at the same time loosen the input selection for other algorithms, so we permit spending of uneconomical inputs when building transactions at minRelayTxFeeRate. That way we retain the Bitcoin Core wallet’s propensity to clean up the UTXO set, but unburden users from extraneous cost.

    Alternatively, we should restrict Knapsack to only spend uneconomical UTXOs at very low feerates. I’d prefer altogether removing it, though, over improving it.


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 09:14 UTC

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