Skip to content

fix(monero-sys): avoid wallet listener handle cycles#999

Draft
copp1723 wants to merge 4 commits intoeigenwallet:masterfrom
copp1723:codex/695-weak-listeners
Draft

fix(monero-sys): avoid wallet listener handle cycles#999
copp1723 wants to merge 4 commits intoeigenwallet:masterfrom
copp1723:codex/695-weak-listeners

Conversation

@copp1723
Copy link
Copy Markdown

@copp1723 copp1723 commented May 11, 2026

Refs #695

Summary

  • Stop wallet event listeners from holding strong wallet handles.
  • Downgrade WalletHandleListener and TauriWalletListener captures to Weak.
  • Skip deferred store/UI/refresh jobs once the wallet handle has gone away instead of queueing work against a closed wallet channel.
  • Return an error from balance_per_subaddress instead of panicking if the wallet channel is closed.

Why

The #695 logs show wallet callbacks queueing store_in_current_file / refresh work around a closed channel, then panicking on closed-channel sends. Weak captures keep callback work tied to live handles only, and the remaining subaddress balance helper now propagates the closed-channel error like the rest of the wallet API.

Verification

  • git diff --check
  • RUSTUP_TOOLCHAIN=stable cargo fmt --check
  • cargo check not fully run locally: monero-sys build script requires the Monero C++ source/submodule and stopped at Target file src/wallet/api/wallet.cpp not found

@Einliterflasche
Copy link
Copy Markdown

Per our AI policy we require all communication to be exclusively human written. Until this requirement is met, we can't spare the effort to review this.

@Einliterflasche Einliterflasche marked this pull request as draft May 11, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants