Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Sqlite PersistedWallet<Connection> Send+Sync #1873

Closed
notmandatory opened this issue Mar 6, 2025 · 0 comments · Fixed by #1874
Closed

Make Sqlite PersistedWallet<Connection> Send+Sync #1873

notmandatory opened this issue Mar 6, 2025 · 0 comments · Fixed by #1874
Assignees
Labels
bug Something isn't working module-wallet
Milestone

Comments

@notmandatory
Copy link
Member

notmandatory commented Mar 6, 2025

Describe the bug

Using PersistedWallet<rusqlite::Connection> is not thread-safe because the PersistedWallet.marker because the rusqlite::Connection type is !Sync.

To Reproduce

Try to use a PersistedWallet<rusqlite::Connection> where a Send + Sync type is required.

Expected behavior

Since PersistedWallet.marker is only PhantomData used by the type system it should not prevent PersistedWallet from being Send + Sync.

Build environment

  • BDK tag/commit: 1.2.0
  • OS+version: any
  • Rust/Cargo version: any
  • Rust/Cargo target: any

Additional context

This issue was identified by @praveenperera who also suggested a solution. See discord chat:

https://discord.com/channels/753336465005608961/978744259693916230/1346317604335386705

@notmandatory notmandatory moved this to Discussion in BDK Core Mar 6, 2025
@notmandatory notmandatory removed this from BDK Core Mar 6, 2025
@notmandatory notmandatory moved this to Todo in BDK Wallet Mar 6, 2025
@notmandatory notmandatory added this to the 1.2.0 milestone Mar 6, 2025
@notmandatory notmandatory added the bug Something isn't working label Mar 6, 2025
@notmandatory notmandatory self-assigned this Mar 6, 2025
@notmandatory notmandatory moved this from Todo to Needs Review in BDK Wallet Mar 6, 2025
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Wallet Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module-wallet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant