From b97cfb5d68a3bf48f486d8dd6c2cca8b6a64f835 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Sat, 12 Aug 2023 20:04:54 +0300 Subject: [PATCH] wallet: change password --- src/wallet/{wallets.rs => wallet.rs} | 8 ++++++++ 1 file changed, 8 insertions(+) rename src/wallet/{wallets.rs => wallet.rs} (98%) diff --git a/src/wallet/wallets.rs b/src/wallet/wallet.rs similarity index 98% rename from src/wallet/wallets.rs rename to src/wallet/wallet.rs index 7d4990f..4a2a97d 100644 --- a/src/wallet/wallets.rs +++ b/src/wallet/wallet.rs @@ -302,6 +302,14 @@ impl Wallet { let r_data = self.data.read().unwrap(); r_data.clone() } + + /// Change wallet password. + pub fn change_password(&self, old: String, new: String) -> Result<(), Error> { + let instance = self.instance.clone().unwrap(); + let mut wallet_lock = instance.lock(); + let lc = wallet_lock.lc_provider()?; + lc.change_password(None, ZeroingString::from(old), ZeroingString::from(new)) + } } /// Delay in seconds to update wallet data every minute as average block time.