take first validator key (#2116)

This commit is contained in:
Preston Van Loon 2019-03-30 15:13:01 -05:00 committed by Raul Jordan
parent e25ec29d17
commit f3a2fc64f1

View File

@ -48,12 +48,18 @@ func NewValidatorService(ctx context.Context, cfg *Config) (*ValidatorService, e
if err != nil { if err != nil {
return nil, fmt.Errorf("could not get private key: %v", err) return nil, fmt.Errorf("could not get private key: %v", err)
} }
var key *keystore.Key
for _, v := range keys {
key = v
break
}
return &ValidatorService{ return &ValidatorService{
ctx: ctx, ctx: ctx,
cancel: cancel, cancel: cancel,
endpoint: cfg.Endpoint, endpoint: cfg.Endpoint,
withCert: cfg.CertFlag, withCert: cfg.CertFlag,
keys: keys, keys: keys,
key: key,
}, nil }, nil
} }