refreshes WalletScanner scanningAccounts on disconnect #5161
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.
Summary
the WalletScanner uses a hash, 'scanFrom', for each account in its scanningAccounts list to check whether it should decrypt notes for the account. if scanFrom is null or equal to the previous block hash then notes are decrypted when connecting a block.
scanFrom is set to the account head when calling refreshScanningAccounts and set to null when connecting a block if scanFrom is equal to the previous hash.
however, when blocks are disconnected scanFrom is not currently changed. in the event of a reorg, decryption is skipped when connecting blocks from the fork if 'scanFrom' is still set to the hash of a disconnected block.
regenerates fixtures for test of this behavior and updates disconnectBlock to set scanFrom to null for all accounts where it is equal to the disconnected block hash.
Testing Plan
Documentation
Does this change require any updates to the Iron Fish Docs (ex. the RPC API
Reference)? If yes, link a
related documentation pull request for the website.
Breaking Change
Is this a breaking change? If yes, add notes below on why this is breaking and label it with
breaking-change-rpc
orbreaking-change-sdk
.