Repository navigation
fix(monero-wallet): hold a weak wallet handle in the wallet listeners - #1230
Merged
binarybaron merged 1 commit intoOct 9, 2026
Merged
binarybaron merged 1 commit into
binarybaron merged 1 commit into
Conversation
WalletHandleListener and TauriWalletListener held an Arc<WalletHandle> to the wallet that owns them. Thus the channel to the wallet thread never closed, and the main wallet never closed. Add WeakWalletHandle, and let the listeners upgrade it in their tokio tasks.
Deploying eigenwallet-docs with
|
| Latest commit: |
0aa8ab7
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://b48cedbc.eigenwallet-docs.pages.dev |
| Branch Preview URL: | https://fix-wallet-listener-weak-han.eigenwallet-docs.pages.dev |
binarybaron
merged commit Oct 9, 2026
0aa8ab7
into
fix/monero-sys-join-wallet-thread
42 of 88 checks passed
Author
|
Moved into #1229. |
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.
Depends on #1229. The base of this PR is the branch of #1229.
WalletHandleListenerandTauriWalletListenerheld anArc<WalletHandle>to the wallet that they listen to. The wallet thread owns its listeners, so the channel to the wallet thread never closed. Thus the main wallet inWalletsnever closed and never did a final store, also after all other holders dropped it.This PR adds
WeakWalletHandle(WalletHandle::downgradeandWeakWalletHandle::upgrade). Both listeners now hold aWeakWalletHandleand upgrade it in their tokio tasks. The upgrade does not occur in the listener callback, because the callbacks run on the wallet thread or on the C++ refresh thread. If the lastWalletHandledropped on the C++ refresh thread, the join from #1229 would deadlock, becausecloseWalletwaits until the C++ refresh thread stops.