Use repo libp2p identiny

This commit is contained in:
Łukasz Magiera
2019-07-10 19:43:19 +02:00
parent e639670195
commit 1f97ad2c2e
2 changed files with 16 additions and 1 deletions
+8 -1
View File
@@ -45,7 +45,7 @@ var _ Repo = &FsRepo{}
func NewFS(path string) (*FsRepo, error) {
path, err := homedir.Expand(path)
if err != nil {
return &FsRepo{}, err
return nil, err
}
return &FsRepo{
@@ -175,6 +175,13 @@ func (fsr *fsLockedRepo) Libp2pIdentity() (crypto.PrivKey, error) {
if err != nil {
return nil, xerrors.Errorf("could not write private key: %w", err)
}
} else if err != nil {
return nil, err
}
stat, err = os.Stat(kpath)
if err != nil {
return nil, err
}
if stat.Mode()&0066 != 0 {