Repository navigation
Conversation
refresh() in the Monero, Wownero and Salvium wallets acquires refreshMutex and released it only on the success path. Anything thrown after the acquire (the Tor and clearnet mismatch check, or wallet being null because open() failed) left the lock held for the rest of the session. Later refreshes returned early on the isLocked check and recover()'s refreshMutex.protect waited forever, which is the stuck rescan dialog in stack-wallet #103. The body now runs under refreshMutex.protect, which releases in a finally and rethrows, the same way the other wallets and recover() in these files already use it. That makes the release-at-100% workaround in onSyncingUpdate redundant, so it is gone from all three wallets. In the Monero wallet highestPercentCached is reset on both sides of rescanBlockchain: before it, so a throw leaves the guard at zero, and after it, so a progress reading from before the rescan cannot be ordered after the reset. Wownero and Salvium call rescanBlockchain unawaited, so the second reset would change nothing there and they keep their order. This is the wallet-layer part of the closed PR #1490, taken on its own.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## staging #1500 +/- ##
===========================================
+ Coverage 10.74% 11.62% +0.87%
===========================================
Files 1132 1134 +2
Lines 113993 114177 +184
===========================================
+ Hits 12254 13272 +1018
+ Misses 101739 100905 -834 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
refresh()in the Monero, Wownero and Salvium wallets releasedrefreshMutexonly on success, so a throw after acquire (the Tor mismatch check, or a null wallet) held the lock for the session and wedged every later refresh and rescan. The body now runs underrefreshMutex.protect, which also retires the release-at-100% workaround inonSyncingUpdate. Wallet-layer part of the closed #1490; reproduced and verified on Linux with a forced Tor mismatch followed by a successful rescan.