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

feat: gracefully handle recovering a duplicate output in LibWallet #3903

Merged

Conversation

philipr-za
Copy link
Contributor

Description

This PR addresses the issue of creating duplicate Faux transaction when an output that has previously been recovered is recovered again. This can happen during reorgs.
It is a small fix to the code that when outputs are scanned to see if they can be rewound only new unique outputs are returned to the caller and duplicate outputs are ignored.
The UTXO scanner will then only create new Faux transactions for the outputs that have not been previously recovered.

Two Rust tests were added to confirm the correct behaviour in output scanning.

This behaviour was already implemented for One-sided payments and a test existed that tested the ignoring of duplicates.

How Has This Been Tested?

Rust tests provided

SWvheerden
SWvheerden previously approved these changes Mar 10, 2022
Copy link
Collaborator

@SWvheerden SWvheerden left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

stringhandler
stringhandler previously approved these changes Mar 15, 2022
@stringhandler stringhandler added the P-conflicts Process - The PR has merge conflicts that need to be resolved label Mar 15, 2022
This PR addresses the issue of creating duplicate Faux transaction when an output that has previously been recovered is recovered again. This can happen during reorgs.
It is a small fix to the code that when outputs are scanned to see if they can be rewound only new unique outputs are returned to the caller and duplicate outputs are ignored.
The UTXO scanner will then only create new Faux transactions for the outputs that have not been previously recovered.

Two Rust tests were added to confirm the correct behaviour in output scanning.

This behaviour was already implemented for One-sided payments and a test existed that tested the ignoring of duplicates.
@philipr-za
Copy link
Contributor Author

@mikethetike conflicts sorted

@philipr-za philipr-za removed the P-conflicts Process - The PR has merge conflicts that need to be resolved label Mar 23, 2022
@stringhandler stringhandler merged commit bcd1418 into tari-project:development Mar 25, 2022
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.

3 participants