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

Fix logic for deciding whether to perform Orchard updates during rescan #5819

Merged
merged 1 commit into from
Apr 5, 2022

Conversation

ebfull
Copy link
Contributor

@ebfull ebfull commented Apr 4, 2022

In ScanForWalletTransactions we skip forward from pindexStart to a block
near our wallet birthday. But we use this as the basis for deciding the value
of performOrchardWalletUpdates later, which is wrong because our wallet
birthday might be beyond the NU5 activation height. The result is that we
won't actually perform the required scanning (mainly witnessing and so forth)
needed to spend notes in our wallet.

@nuttycom
Copy link
Contributor

nuttycom commented Apr 4, 2022

@ebfull looks like you accidentally committed some build artifacts?

@nuttycom
Copy link
Contributor

nuttycom commented Apr 4, 2022

Is there a test that can be written to expose the bug that's being fixed?

In `ScanForWalletTransactions` we skip forward from `pindexStart` to a block
near our wallet birthday. But we use this as the basis for deciding the value
of `performOrchardWalletUpdates` later, which is wrong because our wallet
birthday might be beyond the NU5 activation height. The result is that we
won't actually perform the required scanning (mainly witnessing and so forth)
needed to spend notes in our wallet.
@ebfull
Copy link
Contributor Author

ebfull commented Apr 4, 2022

@nuttycom Yeah, an RPC test could probably exercise this. Start a node, do some stufff (like activating NU5), shut it down, delete the wallet, start it up, do some Orchard transactions, shut it down, start it up with rescan, then try to spend your Orchard funds. At least I think that would do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-orchard Area: Orchard protocol A-wallet Area: Wallet C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants