Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CoinChooser: avoid NotEnoughFunds if zero buckets are sufficient #5752

Closed

Conversation

JeremyRand
Copy link
Contributor

The coin chooser incorrectly raises NotEnoughFunds when the following conditions are both true when make_tx is called:

  • len(coins) == 0
  • The combined value of inputs is sufficient to fund the transaction.

This PR explicitly checks whether an empty bucket is sufficient to fund the transaction, and if so, suppresses the NotEnoughFunds.

@SomberNight
Copy link
Member

Thank you for the report and the code contribution.
I've adapted your change a bit; I think it's more natural to do the check in bucket_candidates_any.

@SomberNight SomberNight added the topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py label Nov 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-wallet 👛 related to wallet.py, or maybe address_synchronizer.py/coinchooser.py
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants