mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-24 20:37:17 +00:00
Accounts V2: Allow user to override password-dir set in the wallet config (#6817)
* Accounts V2: Log a warning when a user specifies --password-dir when it has already been set. * Override wallet config, as user intended * gofmt * Merge refs/heads/master into av2-flag-improvement
This commit is contained in:
parent
dbd2d9a0bb
commit
821f2ec029
@ -175,6 +175,16 @@ func OpenWallet(cliCtx *cli.Context) (*Wallet, error) {
|
||||
return nil, err
|
||||
}
|
||||
w.passwordsDir = directCfg.AccountPasswordsDirectory
|
||||
// If the user provided a flag and for the password directory, and that value does not match
|
||||
// the wallet's configuration then log a warning to the user.
|
||||
// See https://github.com/prysmaticlabs/prysm/issues/6794.
|
||||
if cliCtx.IsSet(flags.WalletPasswordsDirFlag.Name) && cliCtx.String(flags.WalletPasswordsDirFlag.Name) != w.passwordsDir {
|
||||
log.Warnf("The provided value for --%s does not match the wallet configuration. "+
|
||||
"Please edit your wallet password directory using wallet-v2 edit-config.",
|
||||
flags.WalletPasswordsDirFlag.Name,
|
||||
)
|
||||
w.passwordsDir = cliCtx.String(flags.WalletPasswordsDirFlag.Name) // Override config value.
|
||||
}
|
||||
au := aurora.NewAurora(true)
|
||||
log.Infof("%s %s", au.BrightMagenta("(account passwords path)"), w.passwordsDir)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user