Fix Validator Accounts-V2 Runtime (#6714)

* fix accounts v2 runtime
This commit is contained in:
Raul Jordan 2020-07-24 16:36:28 -05:00 committed by GitHub
parent 0b9212c685
commit 55009bfa66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,11 +79,8 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) {
cmd.ConfigureValidator(cliCtx) cmd.ConfigureValidator(cliCtx)
featureconfig.ConfigureValidator(cliCtx) featureconfig.ConfigureValidator(cliCtx)
keyManagerV1, err := selectV1Keymanager(cliCtx)
if err != nil {
return nil, err
}
var keyManagerV1 v1.KeyManager
var keyManagerV2 v2.IKeymanager var keyManagerV2 v2.IKeymanager
if featureconfig.Get().EnableAccountsV2 { if featureconfig.Get().EnableAccountsV2 {
walletDir := cliCtx.String(flags.WalletDirFlag.Name) walletDir := cliCtx.String(flags.WalletDirFlag.Name)
@ -105,6 +102,11 @@ func NewValidatorClient(cliCtx *cli.Context) (*ValidatorClient, error) {
if err != nil { if err != nil {
log.Fatalf("Could not read existing keymanager for wallet: %v", err) log.Fatalf("Could not read existing keymanager for wallet: %v", err)
} }
} else {
keyManagerV1, err = selectV1Keymanager(cliCtx)
if err != nil {
return nil, err
}
} }
pubKeys, err := ExtractPublicKeysFromKeymanager(cliCtx, keyManagerV1, keyManagerV2) pubKeys, err := ExtractPublicKeysFromKeymanager(cliCtx, keyManagerV1, keyManagerV2)