pub async fn change_password(
    config: &GlobalConfig,
    arg_password: Option<String>,
    shutdown_signal: ShutdownSignal,
) -> Result<(), ExitCodes> {
    let mut wallet = init_wallet(config, arg_password, None, None, shutdown_signal).await?;

    let passphrase = prompt_password("New wallet password: ")?;
    let confirmed = prompt_password("Confirm new password: ")?;

    if passphrase != confirmed {
        return Err(ExitCodes::InputError("Passwords don't match!".to_string()));
    }

    wallet.remove_encryption().await?;

    wallet.apply_encryption(passphrase).await?;

    println!("Wallet password changed successfully.");

    Ok(())
}
/// Allows the user to change the password of the wallet.
Allows the user to change the password of the wallet.
Allows the user to change the password of the wallet .
pub async fn change_password(
    config: &GlobalConfig,
    arg_password: Option<String>,
    shutdown_signal: ShutdownSignal,
) -> Result<(), ExitCodes> {
    let mut wallet = init_wallet(config, arg_password, None, None, shutdown_signal).await?;
    let passphrase = prompt_password("New wallet password: ")?;
    let confirmed = prompt_password("Confirm new password: ")?;
    if passphrase != confirmed {
        return Err(ExitCodes::InputError("Passwords don't match!".to_string()));
    }
    wallet.remove_encryption().await?;
    wallet.apply_encryption(passphrase).await?;
    println!("Wallet password changed successfully.");
    Ok(())
}
pub async fn change_password ( config : & GlobalConfig , arg_password : Option < String > , shutdown_signal : ShutdownSignal , ) -> Result < ( ) , ExitCodes > { let mut wallet = init_wallet ( config , arg_password , None , None , shutdown_signal ) . await ? ; let passphrase = prompt_password ( " " ) ? ; let confirmed = prompt_password ( " " ) ? ; if passphrase != confirmed { return Err ( ExitCodes :: InputError ( " " . to_string ( ) ) ) ; } wallet . remove_encryption ( ) . await ? ; wallet . apply_encryption ( passphrase ) . await ? ; println ! ( " " ) ; Ok ( ( ) ) }
Allows the user to change the password of the wallet.
Allows the user to change the password of the wallet .
config
&GlobalConfig
arg_password
Option<String>
shutdown_signal
ShutdownSignal
config
&GlobalConfig
arg_password
Option<String>
shutdown_signal
ShutdownSignal