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

Refactor try_preserving_privacy for correctness and flexibility #70

Closed
Kixunil opened this issue May 10, 2023 · 2 comments · Fixed by #361
Closed

Refactor try_preserving_privacy for correctness and flexibility #70

Kixunil opened this issue May 10, 2023 · 2 comments · Fixed by #361
Labels
api help wanted Extra attention is needed receive receiving payjoin

Comments

@Kixunil
Copy link
Contributor

Kixunil commented May 10, 2023

Original Title: try_preserving_privacy should take something more flexible than HashMap

Some people might want to use a database or a different data structure. The type should be something like impl IntoIterator + Index<OutPoint>

@DanGould DanGould added the receive receiving payjoin label May 27, 2023
@DanGould DanGould added the api label Jul 7, 2023
@DanGould DanGould added this to the 1.0 milestone Jul 10, 2023
@DanGould
Copy link
Contributor

DanGould commented Oct 4, 2023

Since mixed input types aren't allowed in BIP 78 It should alto filter candidate inputs by sender input type or else the sender will reject the proposal. Perhaps a better name would be find_candidate_input_contribution.

It may also be helpful for larger wallets to be able to find multiple candidate input contributions.

Edit for anyone taking this on: Address each comment in this issue separately. Yes try_preserving_privacy could probably use a big refactor but approaching it piecemeal will ease review and better guarantee success.

@DanGould DanGould added the help wanted Extra attention is needed label Oct 4, 2023
@DanGould DanGould changed the title try_preserving_privacy should take something more flexible than HashMap Refactor try_preserving_privacy for correctness and flexibility Oct 4, 2023
@DanGould DanGould modified the milestones: payjoin-1.0, payjoin-0.20.0 Jul 30, 2024
@DanGould
Copy link
Contributor

DanGould commented Oct 7, 2024

It seems like the Index is used for in-memory data structures, not databases, and at least for now, our try_preserving_privacy implementation only needed to iterate. So the solution was just to use impl IntoIterator<(Amount, OutPoint)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api help wanted Extra attention is needed receive receiving payjoin
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants