Skip to content

Commit fb7f6c6

Browse files
committed
Merge bitcoindevkit#233: Fix duplicate wallet creation in non-persistent path
ba5e349 Fix duplicate wallet creation in non-persistent path (Mshehu5) Pull request description: ### Description <!-- Describe the purpose of this PR, what's being adding and/or fixed --> 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. #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: * [x] I'm linking the issue being fixed by this PR The PR addresses bitcoindevkit#232 ACKs for top commit: tvpeter: ACK ba5e349 Tree-SHA512: 56b7b61239b7c5ceb125e9a5858eb880c23577bd22de302e73cb5ab433940f316063dacff40ca5751940fa71d053e1e59abe0d7c041376058b7ef4f317d01505
2 parents 175a606 + ba5e349 commit fb7f6c6

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)