-
Notifications
You must be signed in to change notification settings - Fork 78
Return error on duplicate input contribution #1257
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
base: master
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 20795200310Details
💛 - Coveralls |
|
May I understand your rationale between the two? My question was genuine. It wasn't an instruction in disguise. |
DanGould
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a reasonable approach. Please consider the comment formatting to regular complete sentences.
While working on #1254 based on the discussion by other contributors, it was noted in the issue that:
After implementing the filtering I also considered that erroring out might be a better approach. However I didn’t add this because it wasn’t mentioned in the issue and I was unclear whether erroring on duplicate inputs was the intended flow for contribute_inputs. Based on payjoin-cli this function is mostly used only once so I assumed duplicate inputs might be handled gracefully (by filtering) rather than causing an error. Additionallyz if the inputs are insufficient or intentionally filled with duplicates the logic would still result in a ValueTooLow error if the total amount does not meet the required threshold. These were some of the considerations behind my approach. The reason I submitted a minimal filtering PR was that if erroring out is the preferred behavior it would likely be flagged by other contributors (as you’ve done) which is why I proceeded with a follow-up PR. Incase of next time I think is best I ask more questions in the issue or add notes for reviewers to consider in the PR to better address the issue |
Previously, contribute_inputs() filtered out duplicate inputs when the same outpoint was provided multiple times. This commit changes the behavior to return an explicit error when duplicate inputs are detected.
072d5f8 to
67c5548
Compare
This is a followup to #1254 to address #1254 (comment)
Previously, contribute_inputs() filtered out duplicate inputs when the same outpoint was provided multiple times.
This PR makes it cause an error
Pull Request Checklist
Please confirm the following before requesting review:
AI
in the body of this PR.