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

Missed Solution #20

Closed
yancyribbens opened this issue Jan 5, 2023 · 2 comments
Closed

Missed Solution #20

yancyribbens opened this issue Jan 5, 2023 · 2 comments

Comments

@yancyribbens
Copy link
Collaborator

yancyribbens commented Jan 5, 2023

Recently I've found an edge case where a solution should be found but is not. For example, consider the following UTXO set:

{1, 2, 2.5, 4}

And, if we are looking for a target of 7, the solution ought to be: {1, 2, 4}, however, in my testing, no match is found, even though the combination is possible.

Here is the test that should pass but fails:

#[test]
fn find_solution_test() {
    let utxo_pool = vec![
    MinimalUtxo { value: ONE_BTC },
    MinimalUtxo { value: TWO_BTC },
    MinimalUtxo { value: 2 * ONE_BTC + 50000000 },
    MinimalUtxo { value: FOUR_BTC },
];

see branch: https://github.com/p2pderivatives/rust-bitcoin-coin-selection/tree/bug/incorrect-solution

@yancyribbens
Copy link
Collaborator Author

closed by #28

@yancyribbens
Copy link
Collaborator Author

closed by #30

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 a pull request may close this issue.

1 participant