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

Implement new coin selection algorithm (#301) #541

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sj-fisher
Copy link
Contributor

This is an attempt at implementing a new coin selection algorithm to address #301. Feedback would be appreciated. Please see issue #301 for some notes on how this works and the thinking behind it.

This is a draft pull request because there is one test failure with this code which I would like some advice on (tests/test_wallet_restore.py:364).

@callebtc
Copy link
Collaborator

Hi there! As you might have noticed, the coin selection (I should call it output selection) algorithm has completely changed a few weeks ago. The wallet now selects outputs so that it has at least n of each amount available as a goal. The issue with many small values accumulating should have been fixed with that as well.

Have you had a chance to look at it yet? Here is the function that selects the outputs for a swap:

def split_wallet_state(self, amount: int) -> List[int]:

@sj-fisher
Copy link
Contributor Author

Thanks, I hadn't seen that. Aiming to keep the same number of each denomination of coin in the wallet is a neat idea! Should I close this (and issue #301) or will you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants