diff --git a/cmd/account_cmd.go b/cmd/account_cmd.go index cd754ae4d1..e68f1ed522 100644 --- a/cmd/account_cmd.go +++ b/cmd/account_cmd.go @@ -339,6 +339,10 @@ func accountSet(ctx *cli.Context) error { return err } defer common.ClearPasswd(passwd) + // verify old password + if _, err := wallet.GetAccountByAddress(address, passwd); err != nil { + return fmt.Errorf("invalid old password: %s", err) + } PrintInfoMsg("Please input new password:") newPass, err := password.GetConfirmedPassword() defer common.ClearPasswd(newPass)