[#1136] cli: Allow usage of empty wallet passwords

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-02-04 18:06:30 +03:00 committed by Alex Vanin
parent b86b06c0ca
commit c7a8c762e0

View file

@ -215,9 +215,11 @@ func getKeyNoGenerate() (*ecdsa.PrivateKey, error) {
}
func getPassword() (string, error) {
if pass := viper.GetString(password); pass != "" {
return pass, nil
// this check allows empty passwords
if viper.IsSet(password) {
return viper.GetString(password), nil
}
return input.ReadPassword("Enter password > ")
}