wallet: filter repo.ErrKeyNotFound

This commit is contained in:
Łukasz Magiera 2019-07-31 18:58:19 +02:00
parent d8bd222cb1
commit a968eef322

View File

@ -5,6 +5,8 @@ import (
"strings" "strings"
"github.com/filecoin-project/go-bls-sigs" "github.com/filecoin-project/go-bls-sigs"
"github.com/filecoin-project/go-lotus/node/repo"
"github.com/minio/blake2b-simd" "github.com/minio/blake2b-simd"
"golang.org/x/xerrors" "golang.org/x/xerrors"
@ -71,6 +73,9 @@ func (w *Wallet) findKey(addr address.Address) (*Key, error) {
} }
ki, err := w.keystore.Get(KNamePrefix + addr.String()) ki, err := w.keystore.Get(KNamePrefix + addr.String())
if err != nil { if err != nil {
if xerrors.Is(err, repo.ErrKeyNotFound) {
return nil, nil
}
return nil, xerrors.Errorf("getting from keystore: %w", err) return nil, xerrors.Errorf("getting from keystore: %w", err)
} }
k, err = NewKey(ki) k, err = NewKey(ki)