Skip to content

Make Sqlite PersistedWallet<Connection> Send+Sync #1873

@notmandatory

Description

@notmandatory

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions