This repository was archived by the owner on Aug 18, 2020. It is now read-only.
[CBR-466] fix address reported as unused during restoration #3742
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pr has two parts:
The first part is a bug fix (CBR-466). When we ask for addresses during restoration, even after a tx that uses an address is discovered, the address is still reported as unused. This happens because currently only partial checkpoints are queried and historical checkpoint are ignored. The first commit of this pr solves this issue.
The second part is more of an improvement that was not provided by the old wallet (CBR-193). When we discover a utxo at the begining of restoration, we mark the relevant addresses as used. This means that some addresses are reported as used, even before the tx that uses them is discovered.
Linked issue
https://iohk.myjetbrains.com/youtrack/issue/CBR-193
https://iohk.myjetbrains.com/youtrack/issue/CBR-466
Type of change
Developer checklist
Testing checklist
QA Steps
Start a restoration. When a tx of the wallet is discovered and before restoration finishes, use endpoint api/v1/addresses. The addresses of the tx should all be used:true
Screenshots (if available)