Skip to content

Conversation

@Davidson-Souza
Copy link
Member

This would allow us to make the Electrum Server optional, in case you want to use the json-rpc or even use the wallet directly.

This commit changes the API for our watch-only wallet, wrapping it
inside a RwLock, so all methods take a &self ref, instead of &mut self.

This commit also replaces the watch-only instances in RPC and Electrum
to use Arc<AddressCache> instead of Arc<RwLock<AddressCache>> (i.e. we
have a lock inside the cache itself, so need to have a consumer-level lock)
This change is intended to decouple the watch-only wallet from the
Electrum Server, in case the user don't want the latter. With this
change, you can subscribe the wallet directly, without the need to run
the Electrum Server main loop.

This commit **does not** subscribe the wallet, as we still can't disable
the Electrum Server, and it would be inefficient to notify both (the
Electrum Server needs this notification too, so it can notify connected
clients). In a future patch, we may choose whether to subscribe based on
the user's choice of running an Electrum Server or not.
@Kixunil
Copy link

Kixunil commented Sep 11, 2024

I'd consider going the other way and have the wallet as an external service. To my knowledge, the integrated wallet in Core is a source of significant pain.

@Davidson-Souza
Copy link
Member Author

@Kixunil that's sorta the way I'm going here. I want to make the {electrum, jsonrpc}-server and the watch-only wallet optional. You can even use BDK as a wallet and floresta as the chain backend if you want (if you're using the rust code directly, I think you should).

@Davidson-Souza Davidson-Souza merged commit 6d26c29 into vinteumorg:master Sep 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants