From ba5e349ed31c44cd2083ed6d41313cd9f8d00c53 Mon Sep 17 00:00:00 2001 From: Mshehu5 Date: Thu, 1 Jan 2026 22:13:01 +0100 Subject: [PATCH] Fix duplicate wallet creation in non-persistent path The non-persistent wallet path (when sqlite/redb features are disabled) was creating the wallet twice: first as immutable to create the blockchain_client, then again as mutable. This caused the blockchain_client to be initialized with the first wallet instance, but then used with the second wallet instance, creating a mismatch. --- src/handlers.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/handlers.rs b/src/handlers.rs index 4631186..5439bc0 100644 --- a/src/handlers.rs +++ b/src/handlers.rs @@ -999,10 +999,9 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result { }; #[cfg(not(any(feature = "sqlite", feature = "redb")))] let result = { - let wallet = new_wallet(network, wallet_opts)?; + let mut wallet = new_wallet(network, wallet_opts)?; let blockchain_client = crate::utils::new_blockchain_client(wallet_opts, &wallet, database_path)?; - let mut wallet = new_wallet(network, wallet_opts)?; handle_online_wallet_subcommand(&mut wallet, blockchain_client, online_subcommand) .await? };