Skip to content

Commit ba5e349

Browse files
committed
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.
1 parent 175a606 commit ba5e349

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/handlers.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,10 +999,9 @@ pub(crate) async fn handle_command(cli_opts: CliOpts) -> Result<String, Error> {
999999
};
10001000
#[cfg(not(any(feature = "sqlite", feature = "redb")))]
10011001
let result = {
1002-
let wallet = new_wallet(network, wallet_opts)?;
1002+
let mut wallet = new_wallet(network, wallet_opts)?;
10031003
let blockchain_client =
10041004
crate::utils::new_blockchain_client(wallet_opts, &wallet, database_path)?;
1005-
let mut wallet = new_wallet(network, wallet_opts)?;
10061005
handle_online_wallet_subcommand(&mut wallet, blockchain_client, online_subcommand)
10071006
.await?
10081007
};

0 commit comments

Comments
 (0)