Skip to content

Commit 9c91c66

Browse files
authored
Merge pull request #75 from Ximik/load_wallet-fix
load_wallet: don't spawn new tokio thread if it is already loaded
2 parents de4bb3f + 8420204 commit 9c91c66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/rpc.rs

+3
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,9 @@ impl WalletManager {
562562
}
563563

564564
pub async fn load_wallet(&self, name: &str) -> anyhow::Result<()> {
565+
if self.wallets.read().await.contains_key(name) {
566+
return Ok(());
567+
}
565568
let wallet_dir = self.data_dir.join(name);
566569
if !wallet_dir.exists() {
567570
return Err(anyhow!("Wallet does not exist"));

0 commit comments

Comments
 (0)