-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ledger: fix LookupLatest when the ledger advances (#3769)
## Summary LookupLatest combines base account and resources data, and in some cases it cannot determine reliably how many resources account has, therefore it reads data directly from the DB. The DB might advance causing cachedDBRound (and base account data) and resourceDbRound to be out of sync, and a retry needed. If on retry baseAccount data is outdated, foundAccount flag incorrectly contains a value from a previous iteration causing completion by checkDone because of empty ad (ledgercore.AccountData). Having ad and foundAccount synchronized on retry eliminates the problem. In addition checkDone improved for scenarios when accounts have only own assets. ## Test Plan Added new test
- Loading branch information
1 parent
5978c3d
commit 14544e2
Showing
2 changed files
with
212 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters