-
Notifications
You must be signed in to change notification settings - Fork 592
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wallet: add address-level mutex to avoid duplicates
Because the way the scoped manager uses the OnCommit callback of the database transaction mechanism, the manager's lock is released first, then re-acquired in the OnCommit. But during that short time of releasing the lock, another goroutine might already have updated the in-memory state. We add another mutex around the whole database transaction to address the problem.
- Loading branch information
Showing
2 changed files
with
29 additions
and
0 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