From: codeShark149 Date: Sat, 22 May 2021 16:34:17 +0000 (+0530) Subject: Add to data directory X-Git-Tag: v0.3.0~46 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/database/struct.CommandStringError.html?a=commitdiff_plain;h=79e4fe1f144c1fe2b9cc50e9365bcf83a26c3e28;p=bdk-cli Add to data directory This will append the wallet name provided via configuration flag to bdk-cli into the data directory. So the current structure of datadir is `~/.bdk-bitcoin/compact_filters/. This will let bdk-cli keep multiple wallet directories simultaneously. --- diff --git a/src/bdk_cli.rs b/src/bdk_cli.rs index 45b5bfc..c25ba0b 100644 --- a/src/bdk_cli.rs +++ b/src/bdk_cli.rs @@ -88,7 +88,9 @@ fn prepare_home_dir() -> PathBuf { } fn open_database(wallet_opts: &WalletOpts) -> Tree { - let database = sled::open(prepare_home_dir().to_str().unwrap()).unwrap(); + let mut database_path = prepare_home_dir(); + database_path.push(wallet_opts.wallet.clone()); + let database = sled::open(database_path).unwrap(); let tree = database.open_tree(&wallet_opts.wallet).unwrap(); debug!("database opened successfully"); tree