bitcoindevkit / coin-select

Tool to help you select inputs for making bitcoin transactions.
Other
12 stars 5 forks source link

I'm wondering if this should have been `>=` instead of `>` . The `min_value_and_waste` change policy was previously returning change for excess equal to the min value. #15

Open LLFourn opened 7 months ago

LLFourn commented 7 months ago
          I'm wondering if this should have been `>=` instead of `>` . The `min_value_and_waste` change policy was previously returning change for excess equal to the min value.

_Originally posted by @jp1ac4 in https://github.com/bitcoindevkit/coin-select/pull/14#discussion_r1439665103_

Create a test for this.

jp1ac4 commented 7 months ago

For this test, should it also check that if the change policy min value is 0 and the drain value is 0, then drain_value still returns None (i.e. we don't include a drain with zero value)?

EDIT: Perhaps it would be simpler to keep it as > and let the user set the min value accordingly.

LLFourn commented 7 months ago

Well if we keep it as > we have to change the name since I read min as inclusive.

jp1ac4 commented 1 month ago

Well if we keep it as > we have to change the name since I read min as inclusive.

I agree, I think it's better to change it back to >=. I can try working on this if you like.