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

Change output list should be verified to avoid breaking the UI #69

Open
r4mmer opened this issue May 22, 2024 · 0 comments · Fixed by #70 or #71
Open

Change output list should be verified to avoid breaking the UI #69

r4mmer opened this issue May 22, 2024 · 0 comments · Fixed by #70 or #71
Assignees

Comments

@r4mmer
Copy link
Member

r4mmer commented May 22, 2024

Description

If the change list has duplicated outputs, meaning 2 entries saying that output index X is a change, we will break the output confirming UI.
For instance, if we have 3 outputs and 2 entries on the change list saying that output index 0 is change we will show to the user to confirm outputs:

  • Output 1/1
  • Output 2/1

This can be specially bad if we had 2 outputs, since it actually shows Output 1/0, it can also show Output 1/-1 depending on how we manipulate this.

Solution

When parsing the change list we need to check for duplicates and fail the transaction if any are found.
Since we do not have data on the transaction yet we can parse the change list and when we parse the number of outputs on the transaction we also need to check that the highest change index is on the transaction (since we do not have duplicates this also checks that the number of change outputs is lower than the number of outputs).

@r4mmer r4mmer self-assigned this May 22, 2024
This was linked to pull requests May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant